commit bash-20180309 snapshot

This commit is contained in:
Chet Ramey
2018-03-12 08:10:29 -04:00
parent 2e66dc02d6
commit bf5b8103d4
22 changed files with 350 additions and 17 deletions
+7 -1
View File
@@ -124,6 +124,11 @@ int variable_context = 0;
with the same name at a previous scope. */
int localvar_inherit = 0;
/* If non-zero, calling `unset' on local variables in previous scopes marks
them as invisible so lookups find them unset. This is the same behavior
as local variables in the current local scope. */
int localvar_unset = 0;
/* The set of shell assignments which are made only in the environment
for a single command. */
HASH_TABLE *temporary_env = (HASH_TABLE *)NULL;
@@ -3706,7 +3711,8 @@ makunbound (name, vc)
must be done so that if the variable is subsequently assigned a new
value inside the function, the `local' attribute is still present.
We also need to add it back into the correct hash table. */
if (old_var && local_p (old_var) && variable_context == old_var->context)
if (old_var && local_p (old_var) &&
(old_var->context == variable_context || (localvar_unset && old_var->context < variable_context)))
{
if (nofree_p (old_var))
var_setvalue (old_var, (char *)NULL);