bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix printing command after group with heredoc


From: Chet Ramey
Subject: Re: [PATCH] fix printing command after group with heredoc
Date: Fri, 30 Jun 2023 19:38:39 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

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    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]