bash52-023.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 5.2
  4. Patch-ID: bash52-023
  5. Bug-Reported-by: Emanuele Torre <torreemanuele6@gmail.com>
  6. Bug-Reference-ID: <20230206140824.1710288-1-torreemanuele6@gmail.com>
  7. Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00045.html
  8. Bug-Description:
  9. Running `local -' multiple times in a shell function would overwrite the
  10. original saved set of options.
  11. Patch (apply with `patch -p0'):
  12. *** ../bash-5.2-patched/builtins/declare.def 2023-01-04 20:40:28.000000000 -0500
  13. --- builtins/declare.def 2023-02-08 15:36:49.000000000 -0500
  14. ***************
  15. *** 421,429 ****
  16. if (local_var && variable_context && STREQ (name, "-"))
  17. {
  18. var = make_local_variable ("-", 0);
  19. ! FREE (value_cell (var)); /* just in case */
  20. ! value = get_current_options ();
  21. ! var_setvalue (var, value);
  22. ! VSETATTR (var, att_invisible);
  23. NEXT_VARIABLE ();
  24. }
  25. --- 421,437 ----
  26. if (local_var && variable_context && STREQ (name, "-"))
  27. {
  28. + int o;
  29. +
  30. + o = localvar_inherit;
  31. + localvar_inherit = 0;
  32. var = make_local_variable ("-", 0);
  33. ! localvar_inherit = o;
  34. !
  35. ! if (value_cell (var) == NULL) /* no duplicate instances */
  36. ! {
  37. ! value = get_current_options ();
  38. ! var_setvalue (var, value);
  39. ! VSETATTR (var, att_invisible);
  40. ! }
  41. NEXT_VARIABLE ();
  42. }
  43. *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
  44. --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
  45. ***************
  46. *** 26,30 ****
  47. looks for to find the patch level (for the sccs version string). */
  48. ! #define PATCHLEVEL 22
  49. #endif /* _PATCHLEVEL_H_ */
  50. --- 26,30 ----
  51. looks for to find the patch level (for the sccs version string). */
  52. ! #define PATCHLEVEL 23
  53. #endif /* _PATCHLEVEL_H_ */