perl/Test-Simple: update to 1.302205
[oi-userland.git] / components / shell / bash / patches / bash52-003.patch
blobb2dc4cbcc2e4001d25b17290dd585ab718d13335
1 BASH PATCH REPORT
2 =================
4 Bash-Release: 5.2
5 Patch-ID: bash52-003
7 Bug-Reported-by: D630 <d630@posteo.net>
8 Bug-Reference-ID: <cf8523d58ac75b9ffba9519faa175618@posteo.de>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00092.html
11 Bug-Description:
13 Command substitutions need to preserve newlines instead of replacing them
14 with semicolons, especially in the presence of multiple here-documents.
16 Patch (apply with `patch -p0'):
18 *** ../bash-5.2-patched/print_cmd.c 2022-07-26 09:16:39.000000000 -0400
19 --- print_cmd.c 2022-10-17 10:41:06.000000000 -0400
20 ***************
21 *** 298,305 ****
22 --- 298,307 ----
24 char c = command->value.Connection->connector;
25 + int was_newline;
27 s[0] = printing_comsub ? c : ';';
28 s[1] = '\0';
30 + was_newline = deferred_heredocs == 0 && was_heredoc == 0 && c == '\n';
31 if (deferred_heredocs == 0)
33 ***************
34 *** 315,318 ****
35 --- 317,322 ----
36 if (inside_function_def)
37 cprintf ("\n");
38 + else if (printing_comsub && c == '\n' && was_newline == 0)
39 + cprintf ("\n"); /* preserve newlines in comsubs but don't double them */
40 else
42 ***************
43 *** 1366,1370 ****
45 else
46 ! newline ("}");
48 dispose_command (cmdcopy);
49 --- 1371,1379 ----
51 else
52 ! {
53 ! /* { */
54 ! newline ("}");
55 ! was_heredoc = 0; /* not printing any here-documents now */
56 ! }
58 dispose_command (cmdcopy);
59 ***************
60 *** 1443,1447 ****
62 else
63 ! newline ("}");
65 result = the_printed_command;
66 --- 1452,1459 ----
68 else
69 ! { /* { */
70 ! newline ("}");
71 ! was_heredoc = 0;
72 ! }
74 result = the_printed_command;
75 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
76 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
77 ***************
78 *** 26,30 ****
79 looks for to find the patch level (for the sccs version string). */
81 ! #define PATCHLEVEL 2
83 #endif /* _PATCHLEVEL_H_ */
84 --- 26,30 ----
85 looks for to find the patch level (for the sccs version string). */
87 ! #define PATCHLEVEL 3
89 #endif /* _PATCHLEVEL_H_ */