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

This commit is contained in:
Frédéric Delanoy 2011-08-20 01:58:57 +02:00 committed by Alexandre Julliard
parent bc8fde1c00
commit 303af43ff5
3 changed files with 5 additions and 1 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -223,6 +223,7 @@ C
A
B
C
X
...imbricated FORs
@todo_wine@X Y
@todo_wine@X Y