cmd: Fix invalid "else if" execution.

This commit is contained in:
Thomas Faller 2015-06-24 20:10:04 +02:00 committed by Alexandre Julliard
parent 4f3acf31de
commit 3cda870469
3 changed files with 43 additions and 2 deletions

View File

@ -1561,7 +1561,7 @@ static void WCMD_part_execute(CMD_LIST **cmdList, const WCHAR *firstcmd,
(*cmdList)->command)) {
/* Swap between if and else processing */
processThese = !processThese;
processThese = !executecmds;
/* Process the ELSE part */
if (processThese) {

View File

@ -667,7 +667,45 @@ if /c==/c (
) else (
echo parameter detection seems to be broken
)
SET elseIF=0
if 1 == 1 (
SET /a elseIF=%elseIF%+1
) else if 1 == 1 (
SET /a elseIF=%elseIF%+2
) else (
SET /a elseIF=%elseIF%+2
)
if %elseIF% == 1 (
echo else if seems to work
) else (
echo else if seems to be broken
)
SET elseIF=0
if 1 == 2 (
SET /a elseIF=%elseIF%+2
) else if 1 == 1 (
SET /a elseIF=%elseIF%+1
) else (
SET /a elseIF=%elseIF%+2
)
if %elseIF% == 1 (
echo else if seems to work
) else (
echo else if seems to be broken
)
SET elseIF=0
if 1 == 2 (
SET /a elseIF=%elseIF%+2
) else if 1 == 2 (
SET /a elseIF=%elseIF%+2
) else (
SET /a elseIF=%elseIF%+1
)
if %elseIF% == 1 (
echo else if seems to work
) else (
echo else if seems to be broken
)
echo --- case sensitivity with and without /i option
if bar==BAR echo if does not default to case sensitivity
if not bar==BAR echo if seems to default to case sensitivity

View File

@ -438,6 +438,9 @@ Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on
if seems to work
else seems to work
if seems not to detect /c as parameter
else if seems to work
else if seems to work
else if seems to work
--- case sensitivity with and without /i option
if seems to default to case sensitivity
if /i seems to work