cmd.exe: Add suport for if 1==1 echo yes.

This commit is contained in:
Jason Edmeades 2007-09-11 21:43:05 +01:00 committed by Alexandre Julliard
parent 118f3a6592
commit bcaf4fb43f
2 changed files with 9 additions and 1 deletions

View file

@ -1160,6 +1160,8 @@ void WCMD_if (WCHAR *p, CMD_LIST **cmdList) {
else {
strcpyW (condition, param1);
}
WINE_TRACE("Condition: %s\n", wine_dbgstr_w(condition));
if (!lstrcmpiW (condition, errlvlW)) {
if (errorlevel >= atoiW(WCMD_parameter (p, 1+negate, NULL))) test = 1;
WCMD_parameter (p, 2+negate, &command);

View file

@ -708,6 +708,8 @@ void WCMD_execute (WCHAR *command,
}
p = WCMD_strtrim_leading_spaces (&whichcmd[count]);
WCMD_parse (p, quals, param1, param2);
WINE_TRACE("param1: %s, param2: %s\n", wine_dbgstr_w(param1), wine_dbgstr_w(param2));
switch (i) {
case WCMD_ATTRIB:
@ -1313,11 +1315,15 @@ int p = 0;
case '\0':
return;
default:
while ((*s != '\0') && (*s != ' ') && (*s != '\t')) {
while ((*s != '\0') && (*s != ' ') && (*s != '\t')
&& (*s != '=') && (*s != ',') ) {
if (p == 0) *p1++ = *s++;
else if (p == 1) *p2++ = *s++;
else s++;
}
/* Skip concurrent parms */
while ((*s == ' ') || (*s == '\t') || (*s == '=') || (*s == ',') ) s++;
if (p == 0) *p1 = '\0';
if (p == 1) *p2 = '\0';
p++;