diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index b2a07cb3d6..cc9d835ba4 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -97,7 +97,7 @@ void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HAN /* If processing a call :label, 'goto' the label in question */ if (startLabel) { strcpyW(param1, startLabel); - WCMD_goto(); + WCMD_goto(NULL); } /* diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 665a04382b..6901cd3cf1 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -686,10 +686,13 @@ void WCMD_give_help (WCHAR *command) { * FIXME: DOS is supposed to allow labels with spaces - we don't. */ -void WCMD_goto (void) { +void WCMD_goto (CMD_LIST **cmdList) { WCHAR string[MAX_PATH]; + /* Do not process any more parts of a processed multipart or multilines command */ + *cmdList = NULL; + if (param1[0] == 0x00) { WCMD_output (WCMD_LoadMessage(WCMD_NOARG)); return; diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index b6258e5af6..c1af0bdaea 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -53,7 +53,7 @@ void WCMD_enter_paged_mode(const WCHAR *); void WCMD_exit (void); void WCMD_for (WCHAR *, CMD_LIST **cmdList); void WCMD_give_help (WCHAR *command); -void WCMD_goto (void); +void WCMD_goto (CMD_LIST **cmdList); void WCMD_if (WCHAR *, CMD_LIST **cmdList); void WCMD_leave_paged_mode(void); void WCMD_more (WCHAR *); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index fdb8089cc4..30c19219f2 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -712,7 +712,7 @@ void WCMD_process_command (WCHAR *command, CMD_LIST **cmdList) WCMD_for (p, cmdList); break; case WCMD_GOTO: - WCMD_goto (); + WCMD_goto (cmdList); break; case WCMD_HELP: WCMD_give_help (p);