Commit 303af43f authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

cmd: Fix a FOR parsing bug when multiple spaces follow an IN.

parent bc8fde1c
......@@ -976,7 +976,9 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) {
while (*curPos && *curPos==' ') curPos++;
/* 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));
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 (1,4,1) do echo %%i
for %%i in (A, B,C) do echo %%i
for %%i in (X) do echo %%i
goto :endForTestFun1
:forTestFun1
echo %1
......
......@@ -223,6 +223,7 @@ C
A
B
C
X
...imbricated FORs
@todo_wine@X Y
@todo_wine@X Y
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment