From 895dccd4ac7cc9c8dcb4a679e34fe0b50c560b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 27 Sep 2020 20:24:38 +0200 Subject: [PATCH] [CMD] Cleanup all batch contexts if the execution loop stopped due to EXIT. --- base/shell/cmd/batch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/base/shell/cmd/batch.c b/base/shell/cmd/batch.c index 671be4189d9..36600cd0720 100644 --- a/base/shell/cmd/batch.c +++ b/base/shell/cmd/batch.c @@ -478,6 +478,11 @@ INT Batch(LPTSTR fullname, LPTSTR firstword, LPTSTR param, PARSED_COMMAND *Cmd) ret = ExecuteCommandWithEcho(Cmd); FreeCommand(Cmd); } + if (bExit) + { + /* Stop all execution */ + ExitAllBatches(); + } /* Perform top-level batch cleanup */ if (!bc || bTopLevel)