Bash-5.2 patch 23: fix local - from overwriting saved set of options

This commit is contained in:
Chet Ramey
2024-01-13 18:20:47 -05:00
parent 1a2f3d5139
commit c22ce0d04a
2 changed files with 13 additions and 5 deletions
+12 -4
View File
@@ -420,11 +420,19 @@ declare_internal (list, local_var)
if (local_var && variable_context && STREQ (name, "-"))
{
int o;
o = localvar_inherit;
localvar_inherit = 0;
var = make_local_variable ("-", 0);
FREE (value_cell (var)); /* just in case */
value = get_current_options ();
var_setvalue (var, value);
VSETATTR (var, att_invisible);
localvar_inherit = o;
if (value_cell (var) == NULL) /* no duplicate instances */
{
value = get_current_options ();
var_setvalue (var, value);
VSETATTR (var, att_invisible);
}
NEXT_VARIABLE ();
}
+1 -1
View File
@@ -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 22
#define PATCHLEVEL 23
#endif /* _PATCHLEVEL_H_ */