bash-4.1-006.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.1
  4. Patch-ID: bash41-006
  5. Bug-Reported-by: Mike Frysinger <vapier@gentoo.org>
  6. Bug-Reference-ID: <201003210155.56618.vapier@gentoo.org>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00063.html
  8. Bug-Description:
  9. Bash did not correctly print/reproduce here documents attached to commands
  10. inside compound commands such as for and while. This affected the
  11. execution of such commands inside a shell function when the function
  12. definition is saved and later restored using `.' or `eval'.
  13. Patch (apply with `patch -p0'):
  14. *** ../bash-4.1-patched/print_cmd.c 2009-09-16 15:32:26.000000000 -0400
  15. --- ./print_cmd.c 2010-03-22 21:15:30.000000000 -0400
  16. ***************
  17. *** 114,117 ****
  18. --- 114,123 ----
  19. #define CHECK_XTRACE_FP xtrace_fp = (xtrace_fp ? xtrace_fp : stderr)
  20. + #define PRINT_DEFERRED_HEREDOCS(x) \
  21. + do { \
  22. + if (deferred_heredocs) \
  23. + print_deferred_heredocs (x); \
  24. + } while (0)
  25. +
  26. /* Non-zero means the stuff being printed is inside of a function def. */
  27. static int inside_function_def;
  28. ***************
  29. *** 561,571 ****
  30. {
  31. print_for_command_head (for_command);
  32. -
  33. cprintf (";");
  34. newline ("do\n");
  35. indentation += indentation_amount;
  36. make_command_string_internal (for_command->action);
  37. semicolon ();
  38. indentation -= indentation_amount;
  39. newline ("done");
  40. }
  41. --- 566,578 ----
  42. {
  43. print_for_command_head (for_command);
  44. cprintf (";");
  45. newline ("do\n");
  46. +
  47. indentation += indentation_amount;
  48. make_command_string_internal (for_command->action);
  49. + PRINT_DEFERRED_HEREDOCS ("");
  50. semicolon ();
  51. indentation -= indentation_amount;
  52. +
  53. newline ("done");
  54. }
  55. *** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
  56. --- ./patchlevel.h 2010-01-14 09:38:08.000000000 -0500
  57. ***************
  58. *** 26,30 ****
  59. looks for to find the patch level (for the sccs version string). */
  60. ! #define PATCHLEVEL 5
  61. #endif /* _PATCHLEVEL_H_ */
  62. --- 26,30 ----
  63. looks for to find the patch level (for the sccs version string). */
  64. ! #define PATCHLEVEL 6
  65. #endif /* _PATCHLEVEL_H_ */