summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2022-09-26 11:49:46 -0400
committerChet Ramey <chet.ramey@case.edu>2022-09-26 11:49:46 -0400
commit74091dd4e8086db518b30df7f222691524469998 (patch)
treeebe89d8f0ed44b7f79aa3c759d3f85e15996eaee /eval.c
parent9439ce094c9aa7557a9d53ac7b412a23aa66e36b (diff)
downloadbash-74091dd4e8086db518b30df7f222691524469998.tar.gz
bash-5.2 distribution sources and documentationbash-5.2
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c11
1 files changed, 6 insertions, 5 deletions
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;
}