On 6/29/23 4:05 AM, Grisha Levit wrote:
If the last redirection list in a group / subshell / substitution has
a heredoc and the following connector is a semicolon, the connector is
incorrectly skipped over.
Try this patch instead:
*** ../bash-20230628/print_cmd.c Mon Jun 26 16:56:46 2023
--- print_cmd.c Fri Jun 30 19:35:35 2023
***************
*** 346,349 ****
--- 352,356 ----
PRINT_DEFERRED_HEREDOCS ("");
cprintf (" )");
+ was_heredoc = 0; /* last wasn't heredoc/newline */
break;
***************
*** 699,702 ****
--- 706,710 ----
cprintf ("}");
+ was_heredoc = 0; /* last wasn't heredoc/newline */
group_command_nesting--;
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/