cmd: Fix 'else', with tests.

This commit is contained in:
Dan Kegel 2010-02-17 23:11:04 -08:00 committed by Alexandre Julliard
parent 12feffe49e
commit 8110dde8ae
3 changed files with 18 additions and 1 deletions

View File

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

View File

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

View File

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