7 Bug-Reported-by: Emanuele Torre <torreemanuele6@gmail.com>
8 Bug-Reference-ID: <20230206140824.1710288-1-torreemanuele6@gmail.com>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00045.html
13 Running `local -' multiple times in a shell function would overwrite the
14 original saved set of options.
16 Patch (apply with `patch -p0'):
18 *** ../bash-5.2-patched/builtins/declare.def 2023-01-04 20:40:28.000000000 -0500
19 --- builtins/declare.def 2023-02-08 15:36:49.000000000 -0500
22 if (local_var && variable_context && STREQ (name, "-"))
24 var = make_local_variable ("-", 0);
25 ! FREE (value_cell (var)); /* just in case */
26 ! value = get_current_options ();
27 ! var_setvalue (var, value);
28 ! VSETATTR (var, att_invisible);
32 if (local_var && variable_context && STREQ (name, "-"))
36 + o = localvar_inherit;
37 + localvar_inherit = 0;
38 var = make_local_variable ("-", 0);
39 ! localvar_inherit = o;
41 ! if (value_cell (var) == NULL) /* no duplicate instances */
43 ! value = get_current_options ();
44 ! var_setvalue (var, value);
45 ! VSETATTR (var, att_invisible);
50 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
51 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
54 looks for to find the patch level (for the sccs version string). */
56 ! #define PATCHLEVEL 22
58 #endif /* _PATCHLEVEL_H_ */
60 looks for to find the patch level (for the sccs version string). */
62 ! #define PATCHLEVEL 23
64 #endif /* _PATCHLEVEL_H_ */