cmd: Fix 'else', with tests.
This commit is contained in:
parent
12feffe49e
commit
8110dde8ae
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue