Subversion Repositories SvarDOS

Rev

Rev 1134 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1134 Rev 1137
Line 58... Line 58...
58
      }
58
      }
59
      outputnl(buff);
59
      outputnl(buff);
60
    }
60
    }
61
  } else { /* set variable (do not rely on argv, SET has its own rules...) */
61
  } else { /* set variable (do not rely on argv, SET has its own rules...) */
62
    const char far *ptr;
62
    const char far *ptr;
63
    unsigned short i, errcode = 0;
63
    unsigned short i;
64
 
64
 
65
    /* locate the first space or tab */
65
    /* locate the first space or tab */
66
    for (ptr = p->cmdline; ((*ptr != ' ') && (*ptr != '\t')); ptr++);
66
    for (ptr = p->cmdline; ((*ptr != ' ') && (*ptr != '\t')); ptr++);
67
 
67
 
68
    /* now locate the first non-space/non-tab: that's where the variable name begins */
68
    /* now locate the first non-space/non-tab: that's where the variable name begins */
Line 73... Line 73...
73
    for (; *ptr != '='; ptr++) {
73
    for (; *ptr != '='; ptr++) {
74
      if (*ptr == 0) goto syntax_err;
74
      if (*ptr == 0) goto syntax_err;
75
      buff[i++] = *ptr;
75
      buff[i++] = *ptr;
76
    }
76
    }
77
 
77
 
78
    /* make variable name all caps */
78
    /* make variable name all caps (country-dependend) */
79
    _asm {
-
 
80
      push ax
-
 
81
      push cx
-
 
82
      push dx
-
 
83
 
-
 
84
      mov ax, 0x6521 /* country-dependent capitalize string (DOS 4+) */
-
 
85
      mov cx, [i]    /* CX=length of string */
-
 
86
      mov dx, buff   /* DS:DX->string to capitalize */
-
 
87
      int 0x21
-
 
88
      jnc DONE
79
    buff[i] = 0;
89
      mov [errcode], ax
-
 
90
      DONE:
-
 
91
 
-
 
92
      pop dx
-
 
93
      pop cx
-
 
94
      pop ax
-
 
95
    }
-
 
96
    if (errcode != 0) {
-
 
97
      nls_outputnl_doserr(errcode);
-
 
98
      return(CMD_FAIL);
80
    nls_strtoup(buff);
99
    }
-
 
100
 
81
 
101
    /* copy value now */
82
    /* copy value now */
102
    while (*ptr != 0) {
83
    while (*ptr != 0) {
103
      buff[i++] = *ptr;
84
      buff[i++] = *ptr;
104
      ptr++;
85
      ptr++;