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