From 3b8e45fbf62e8c57a2c886936f5607cb2cba5e35 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Thu, 13 Nov 2008 17:44:25 -0500 Subject: [PATCH] Patch-ID: bash32-047 Bug-Reported-by: Roman Rakus Bug-Reference-ID: <48A89EBC.906@redhat.com> Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2008-08/msg00026.html Bug-Description: When using the `.' (source) builtin, under certain circumstances bash was too careful in discarding state to preserve internal consistency. One effect was that assignments to readonly variables would cause entire scripts to be aborted instead of execution of the offending command. This behavior was introduced by bash-3.2 patch 20. This patch, in file bash32-047, was downloaded from ftp.gnu.org on 2011-05-29, and bash32-047.sig was furthermore verified, yielding the following output: gpg: Signature made Tue 18 Nov 2008 08:12:08 AM EST using DSA key ID 64EA74AB gpg: Good signature from "Chet Ramey " --- patchlevel.h | 2 +- subst.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/patchlevel.h b/patchlevel.h index b33245d..9c87fb4 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 46 +#define PATCHLEVEL 47 #endif /* _PATCHLEVEL_H_ */ diff --git a/subst.c b/subst.c index ecf074f..089457f 100644 --- a/subst.c +++ b/subst.c @@ -137,7 +137,7 @@ unsigned char ifs_firstc; /* Extern functions and variables from different files. */ extern int last_command_exit_value, last_command_exit_signal; extern int subshell_environment; -extern int subshell_level; +extern int subshell_level, parse_and_execute_level; extern int eof_encountered; extern int return_catch_flag, return_catch_value; extern pid_t dollar_dollar_pid; @@ -7672,7 +7672,9 @@ exp_jump_to_top_level (v) expand_no_split_dollar_star = 0; /* XXX */ expanding_redir = 0; - top_level_cleanup (); /* from sig.c */ + if (parse_and_execute_level == 0) + top_level_cleanup (); /* from sig.c */ + jump_to_top_level (v); } -- 2.11.4.GIT