From 74091dd4e8086db518b30df7f222691524469998 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Mon, 26 Sep 2022 11:49:46 -0400 Subject: bash-5.2 distribution sources and documentation --- eval.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 1d967da1..17fbf736 100644 --- a/eval.c +++ b/eval.c @@ -1,6 +1,6 @@ /* eval.c -- reading and evaluating commands. */ -/* Copyright (C) 1996-2020 Free Software Foundation, Inc. +/* Copyright (C) 1996-2022 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -90,12 +90,13 @@ reader_loop () switch (code) { /* Some kind of throw to top_level has occurred. */ - case FORCE_EOF: case ERREXIT: + if (exit_immediately_on_error) + reset_local_contexts (); /* not in a function */ + case FORCE_EOF: case EXITPROG: + case EXITBLTIN: current_command = (COMMAND *)NULL; - if (exit_immediately_on_error) - variable_context = 0; /* not in a function */ EOF_Reached = EOF; goto exec_done; @@ -139,7 +140,7 @@ reader_loop () { if (interactive_shell == 0 && read_but_dont_execute) { - set_exit_status (EXECUTION_SUCCESS); + set_exit_status (last_command_exit_value); dispose_command (global_command); global_command = (COMMAND *)NULL; } -- cgit v1.2.1