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
+3 -1
View File
@@ -363,12 +363,14 @@ parse_and_execute (string, from_file, flags)
these circumstances. Don't bother with cleanup here because
we don't want to run the function execution cleanup stuff
that will cause pop_context and other functions to run.
We call reset_local_contexts() instead, which just frees
context memory.
XXX - change that if we want the function context to be
unwound. */
if (exit_immediately_on_error && variable_context)
{
discard_unwind_frame ("pe_dispose");
variable_context = 0; /* not in a function */
reset_local_contexts (); /* not in a function */
}
should_jump_to_top_level = 1;
goto out;