bash-4.1-004.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.1
  4. Patch-ID: bash41-004
  5. Bug-Reported-by: Crestez Dan Leonard <cdleonard@gmail.com>
  6. Bug-Reference-ID: <1265592839.30682.21.camel@deskbox>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00034.html
  8. Bug-Description:
  9. When running in Posix mode and executing a shell function without local
  10. variables, bash will not propagate a variable in a special builtin's temporary
  11. environment to have global scope.
  12. Patch (apply with `patch -p0'):
  13. *** ../bash-4.1-patched/variables.c 2009-11-03 14:13:58.000000000 -0500
  14. --- ./variables.c 2010-02-08 17:36:18.000000000 -0500
  15. ***************
  16. *** 3809,3812 ****
  17. --- 3809,3817 ----
  18. if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate)))
  19. {
  20. + /* Make sure we have a hash table to store the variable in while it is
  21. + being propagated down to the global variables table. Create one if
  22. + we have to */
  23. + if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
  24. + shell_variables->table = hash_create (0);
  25. /* XXX - should we set v->context here? */
  26. v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
  27. *** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
  28. --- ./patchlevel.h 2010-01-14 09:38:08.000000000 -0500
  29. ***************
  30. *** 26,30 ****
  31. looks for to find the patch level (for the sccs version string). */
  32. ! #define PATCHLEVEL 3
  33. #endif /* _PATCHLEVEL_H_ */
  34. --- 26,30 ----
  35. looks for to find the patch level (for the sccs version string). */
  36. ! #define PATCHLEVEL 4
  37. #endif /* _PATCHLEVEL_H_ */