cmd: Fix a FOR parsing bug when multiple spaces follow an IN.
This commit is contained in:
parent
bc8fde1c00
commit
303af43ff5
|
@ -976,7 +976,9 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
|
||||||
while (*curPos && *curPos==' ') curPos++;
|
while (*curPos && *curPos==' ') curPos++;
|
||||||
|
|
||||||
/* Ensure line continues with IN */
|
/* Ensure line continues with IN */
|
||||||
if (!*curPos || lstrcmpiW (curPos, inW)) {
|
if (!*curPos
|
||||||
|
|| CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT,
|
||||||
|
curPos, 3, inW, -1) != CSTR_EQUAL) {
|
||||||
WCMD_output (WCMD_LoadMessage(WCMD_SYNTAXERR));
|
WCMD_output (WCMD_LoadMessage(WCMD_SYNTAXERR));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -318,6 +318,7 @@ for %%i in (A B C) do echo %%j
|
||||||
for %%i in (A B C) do call :forTestFun1 %%i
|
for %%i in (A B C) do call :forTestFun1 %%i
|
||||||
for %%i in (1,4,1) do echo %%i
|
for %%i in (1,4,1) do echo %%i
|
||||||
for %%i in (A, B,C) do echo %%i
|
for %%i in (A, B,C) do echo %%i
|
||||||
|
for %%i in (X) do echo %%i
|
||||||
goto :endForTestFun1
|
goto :endForTestFun1
|
||||||
:forTestFun1
|
:forTestFun1
|
||||||
echo %1
|
echo %1
|
||||||
|
|
|
@ -223,6 +223,7 @@ C
|
||||||
A
|
A
|
||||||
B
|
B
|
||||||
C
|
C
|
||||||
|
X
|
||||||
...imbricated FORs
|
...imbricated FORs
|
||||||
@todo_wine@X Y
|
@todo_wine@X Y
|
||||||
@todo_wine@X Y
|
@todo_wine@X Y
|
||||||
|
|
Loading…
Reference in New Issue