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
+1 -1
View File
@@ -94,7 +94,7 @@ INCLUDES = -I. -I.. @RL_INCLUDE@ -I$(topdir) -I$(BASHINCDIR) -I$(topdir)/lib -I$
BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \
${INCLUDES} $(LOCAL_CFLAGS)
CCFLAGS = ${ASAN_CFLAGS} $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS)
CCFLAGS = ${ADDON_CFLAGS} $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS)
CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
+19 -2
View File
@@ -573,8 +573,9 @@ restart_new_var_name:
}
/* However, if we're turning off the nameref attribute on an existing
nameref variable, we first follow the nameref chain to the end,
modify the value of the variable this nameref variable references,
*CHANGING ITS VALUE AS A SIDE EFFECT* then turn off the nameref
modify the value of the variable this nameref variable references
if there is an assignment statement argument,
*CHANGING ITS VALUE AS A SIDE EFFECT*, then turn off the nameref
flag *LEAVING THE NAMEREF VARIABLE'S VALUE UNCHANGED* */
else if (var == 0 && (flags_off & att_nameref))
{
@@ -592,6 +593,16 @@ restart_new_var_name:
any_failed++;
NEXT_VARIABLE ();
}
/* If all we're doing is turning off the nameref attribute, don't
bother with VAR at all, whether it exists or not. Just turn it
off and go on. */
if (refvar && flags_on == 0 && offset == 0 && (flags_off & ~att_nameref) == 0)
{
VUNSETATTR (refvar, att_nameref);
NEXT_VARIABLE ();
}
if (refvar)
/* XXX - use declare_find_variable here? */
var = mkglobal ? find_global_variable (nameref_cell (refvar)) : find_variable (nameref_cell (refvar));
@@ -671,6 +682,12 @@ restart_new_var_name:
value = name + namelen;
}
free (oldname);
/* OK, let's turn off the nameref attribute.
Now everything else applies to VAR. */
if (flags_off & att_nameref)
VUNSETATTR (refvar, att_nameref);
goto restart_new_var_name;
/* NOTREACHED */
}
+4
View File
@@ -92,6 +92,7 @@ extern int glob_asciirange;
extern int lastpipe_opt;
extern int inherit_errexit;
extern int localvar_inherit;
extern int localvar_unset;
#if defined (EXTENDED_GLOB)
extern int extended_glob;
@@ -214,6 +215,9 @@ static struct {
{ "lithist", &literal_history, (shopt_set_func_t *)NULL },
#endif
{ "localvar_inherit", &localvar_inherit, (shopt_set_func_t *)NULL },
#if 0
{ "localvar_unset", &localvar_unset, (shopt_set_func_t *)NULL },
#endif
{ "login_shell", &shopt_login_shell, set_login_shell },
{ "mailwarn", &mail_warning, (shopt_set_func_t *)NULL },
#if defined (READLINE)