From: Eric Pouech epouech@codeweavers.com
Signed-off-by: Eric Pouech epouech@codeweavers.com --- programs/cmd/batch.c | 3 ++- programs/cmd/wcmd.h | 2 +- programs/cmd/wcmdmain.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 914d9d7f3e3..37db7fb2b04 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -645,7 +645,7 @@ extern void WCMD_expand(const WCHAR *, WCHAR *); * If there is a leading ':', calls within this batch program * otherwise launches another program. */ -void WCMD_call(WCHAR *command) +RETURN_CODE WCMD_call(WCHAR *command) { WCHAR buffer[MAXSTRING]; WCMD_expand(command, buffer); @@ -680,4 +680,5 @@ void WCMD_call(WCHAR *command) WCMD_restore_for_loop_context(); } else WCMD_output_asis_stderr(WCMD_LoadMessage(WCMD_CALLINSCRIPT)); + return errorlevel ? ERROR_INVALID_FUNCTION : NO_ERROR; } diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index 7f4bf69979a..8dfc89534d6 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -159,7 +159,7 @@ typedef int RETURN_CODE;
void WCMD_assoc (const WCHAR *, BOOL); void WCMD_batch(WCHAR *, WCHAR *, WCHAR *, HANDLE); -void WCMD_call (WCHAR *command); +RETURN_CODE WCMD_call(WCHAR *command); void WCMD_change_tty (void); void WCMD_choice (const WCHAR *); void WCMD_clear_screen (void); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index cbea093f400..860ca872ffc 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1808,7 +1808,7 @@ static RETURN_CODE execute_single_command(const WCHAR *command) switch (cmd_index) {
case WCMD_CALL: - WCMD_call (parms_start); + return_code = WCMD_call(parms_start); break; case WCMD_CD: case WCMD_CHDIR: