134-upstream-bash43-034.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.3
  4. Patch-ID: bash43-034
  5. Bug-Reported-by: Dreamcat4 <dreamcat4@gmail.com>
  6. Bug-Reference-ID: <CAN39uTpAEs2GFu4ebC_SfSVMRTh-DJ9YanrY4BZZ3OO+CCHjng@mail.gmail.com>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-05/msg00001.html
  8. Bug-Description:
  9. If neither the -f nor -v options is supplied to unset, and a name argument is
  10. found to be a function and unset, subsequent name arguments are not treated as
  11. variables before attempting to unset a function by that name.
  12. Patch (apply with `patch -p0'):
  13. --- a/builtins/set.def
  14. +++ b/builtins/set.def
  15. @@ -751,9 +751,11 @@ unset_builtin (list)
  16. WORD_LIST *list;
  17. {
  18. int unset_function, unset_variable, unset_array, opt, nameref, any_failed;
  19. + int global_unset_func, global_unset_var;
  20. char *name;
  21. unset_function = unset_variable = unset_array = nameref = any_failed = 0;
  22. + global_unset_func = global_unset_var = 0;
  23. reset_internal_getopt ();
  24. while ((opt = internal_getopt (list, "fnv")) != -1)
  25. @@ -761,10 +763,10 @@ unset_builtin (list)
  26. switch (opt)
  27. {
  28. case 'f':
  29. - unset_function = 1;
  30. + global_unset_func = 1;
  31. break;
  32. case 'v':
  33. - unset_variable = 1;
  34. + global_unset_var = 1;
  35. break;
  36. case 'n':
  37. nameref = 1;
  38. @@ -777,7 +779,7 @@ unset_builtin (list)
  39. list = loptend;
  40. - if (unset_function && unset_variable)
  41. + if (global_unset_func && global_unset_var)
  42. {
  43. builtin_error (_("cannot simultaneously unset a function and a variable"));
  44. return (EXECUTION_FAILURE);
  45. @@ -795,6 +797,9 @@ unset_builtin (list)
  46. name = list->word->word;
  47. + unset_function = global_unset_func;
  48. + unset_variable = global_unset_var;
  49. +
  50. #if defined (ARRAY_VARS)
  51. unset_array = 0;
  52. if (!unset_function && valid_array_reference (name))
  53. --- a/patchlevel.h
  54. +++ b/patchlevel.h
  55. @@ -25,6 +25,6 @@
  56. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  57. looks for to find the patch level (for the sccs version string). */
  58. -#define PATCHLEVEL 33
  59. +#define PATCHLEVEL 34
  60. #endif /* _PATCHLEVEL_H_ */