Commit 3cda8704 authored by Thomas Faller's avatar Thomas Faller Committed by Alexandre Julliard

cmd: Fix invalid "else if" execution.

parent 4f3acf31
...@@ -1561,7 +1561,7 @@ static void WCMD_part_execute(CMD_LIST **cmdList, const WCHAR *firstcmd, ...@@ -1561,7 +1561,7 @@ static void WCMD_part_execute(CMD_LIST **cmdList, const WCHAR *firstcmd,
(*cmdList)->command)) { (*cmdList)->command)) {
/* Swap between if and else processing */ /* Swap between if and else processing */
processThese = !processThese; processThese = !executecmds;
/* Process the ELSE part */ /* Process the ELSE part */
if (processThese) { if (processThese) {
......
...@@ -667,7 +667,45 @@ if /c==/c ( ...@@ -667,7 +667,45 @@ if /c==/c (
) else ( ) else (
echo parameter detection seems to be broken 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 echo --- case sensitivity with and without /i option
if bar==BAR echo if does not default to case sensitivity if bar==BAR echo if does not default to case sensitivity
if not bar==BAR echo if seems to default to case sensitivity if not bar==BAR echo if seems to default to case sensitivity
......
...@@ -438,6 +438,9 @@ Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on ...@@ -438,6 +438,9 @@ Passed: file size check on subdir\a.a [8]@or_broken@Skipping file size check on
if seems to work if seems to work
else seems to work else seems to work
if seems not to detect /c as parameter 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 --- case sensitivity with and without /i option
if seems to default to case sensitivity if seems to default to case sensitivity
if /i seems to work if /i seems to work
......
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