fix for local variable problem in EXIT trap; add sed-like behavior for null patterns in pattern substitution

This commit is contained in:
Chet Ramey
2022-07-19 11:42:23 -04:00
parent 87a6e89edc
commit 52ae6c3f5d
12 changed files with 125 additions and 45 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
/* eval.c -- reading and evaluating commands. */
/* Copyright (C) 1996-2021 Free Software Foundation, Inc.
/* Copyright (C) 1996-2022 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -90,13 +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;