bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bash-5.2 Patch 23


From: Chet Ramey
Subject: Bash-5.2 Patch 23
Date: Sun, 14 Jan 2024 13:34:39 -0500

                             BASH PATCH REPORT
                             =================

Bash-Release:   5.2
Patch-ID:       bash52-023

Bug-Reported-by:        Emanuele Torre <torreemanuele6@gmail.com>
Bug-Reference-ID:       <20230206140824.1710288-1-torreemanuele6@gmail.com>
Bug-Reference-URL:      
https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00045.html

Bug-Description:

Running `local -' multiple times in a shell function would overwrite the
original saved set of options.

Patch (apply with `patch -p0'):

*** ../bash-5.2-patched/builtins/declare.def    2023-01-04 20:40:28.000000000 
-0500
--- builtins/declare.def        2023-02-08 15:36:49.000000000 -0500
***************
*** 421,429 ****
        if (local_var && variable_context && STREQ (name, "-"))
        {
          var = make_local_variable ("-", 0);
!         FREE (value_cell (var));              /* just in case */
!         value = get_current_options ();
!         var_setvalue (var, value);
!         VSETATTR (var, att_invisible);
          NEXT_VARIABLE ();
        }
--- 421,437 ----
        if (local_var && variable_context && STREQ (name, "-"))
        {
+         int o;
+ 
+         o = localvar_inherit;
+         localvar_inherit = 0;
          var = make_local_variable ("-", 0);
!         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 ();
        }

*** ../bash-5.2/patchlevel.h    2020-06-22 14:51:03.000000000 -0400
--- patchlevel.h        2020-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 22
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 23
  
  #endif /* _PATCHLEVEL_H_ */

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]