Commit 8110dde8 authored by Dan Kegel's avatar Dan Kegel Committed by Alexandre Julliard

cmd: Fix 'else', with tests.

parent 12feffe4
......@@ -1072,7 +1072,7 @@ void WCMD_part_execute(CMD_LIST **cmdList, WCHAR *firstcmd, WCHAR *variable,
/* Execute any statements appended to the line */
/* FIXME: Only if previous call worked for && or failed for || */
if ((*cmdList)->prevDelim == CMD_ONFAILURE ||
(*cmdList)->prevDelim != CMD_ONSUCCESS) {
(*cmdList)->prevDelim == CMD_ONSUCCESS) {
if (processThese && (*cmdList)->command) {
WCMD_execute ((*cmdList)->command, (*cmdList)->redirects, variable,
value, cmdList);
......
......@@ -23,3 +23,16 @@ cd dummydir
echo %~dp0
cd ..
rmdir dummydir
echo ------------ Testing if/else --------------
echo if/else should work with blocks
if 0 == 0 (
echo if seems to work
) else (
echo if seems to be broken
)
if 1 == 0 (
echo else seems to be broken
) else (
echo else seems to work
)
......@@ -16,3 +16,7 @@ bar
~dp0 should be directory containing batch file
@pwd@\
@pwd@\
------------ Testing if/else --------------
if/else should work with blocks
if seems to work
else 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