commit bash-20180601 snapshot

This commit is contained in:
Chet Ramey
2018-06-04 09:58:58 -04:00
parent 5c5c75236c
commit 3e03eafff8
25 changed files with 347 additions and 319 deletions
+14 -9
View File
@@ -560,18 +560,23 @@ set_var_attribute (name, attribute, undo)
var->attributes |= tv->attributes & ~att_tempvar;
/* This avoids an error message when propagating a read-only var
later on. */
if (var->context == 0 && (attribute & att_readonly))
if (posixly_correct || shell_compatibility_level <= 44)
{
/* Don't bother to set the `propagate to the global variables
table' flag if we've just bound the variable in that table */
v = find_global_variable (tv->name);
if (v != var)
if (var->context == 0 && (attribute & att_readonly))
{
/* Don't bother to set the `propagate to the global variables
table' flag if we've just bound the variable in that
table */
v = find_global_variable (tv->name);
if (v != var)
VSETATTR (tv, att_propagate);
}
else
VSETATTR (tv, att_propagate);
if (var->context != 0)
VSETATTR (var, att_propagate);
}
else
VSETATTR (tv, att_propagate);
if (var->context != 0)
VSETATTR (var, att_propagate);
SETVARATTR (tv, attribute, undo); /* XXX */
stupidly_hack_special_variables (tv->name);