cmd: Reset ignoreBracket when moving to the next line.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55528
This commit is contained in:
Alex Henrie 2023-09-06 22:56:59 -06:00 committed by Alexandre Julliard
parent 01fab4c409
commit 8f28294434
3 changed files with 15 additions and 0 deletions

View file

@ -1276,9 +1276,21 @@ if ""=="" for %%i in (A) DO (echo %%i)
if not ""=="" for %%i in (B) DO (echo %%i)
echo ------------ Testing if/set ------------
rem a left parenthesis is part of the value, not the start of an 'if' block
set x=C:\Program Files (x86)
if ""=="" set y=%x%\dummy
echo %y%
if 1 == 1 set z= (
echo '%z%'
rem 'set' in one-line 'if' statement does not interfere with other 'if' blocks
setlocal enableDelayedExpansion
if 1 == 1 (
if 1 == 1 set z=zeta
if 1 == 1 (
echo !z!
)
)
endlocal
echo --- Testing if + var subst in delayed expansion mode
setlocal enableDelayedExpansion

View file

@ -928,6 +928,8 @@ x@space@
A
------------ Testing if/set ------------
C:\Program Files (x86)\dummy
' ('
zeta
--- Testing if + var subst in delayed expansion mode
[DEBUG] checking {abc}
[DEBUG] checking {10.0}

View file

@ -2302,6 +2302,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
WINE_TRACE("Need to read more data as outstanding brackets or carets\n");
inOneLine = FALSE;
ignoreBracket = FALSE;
prevDelim = CMD_NONE;
inQuotes = 0;
memset(extraSpace, 0x00, (MAXSTRING+1) * sizeof(WCHAR));