diff options
-rw-r--r-- | shell/ash.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/shell/ash.c b/shell/ash.c index fbe8dd9e4..e0ddf7198 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -12733,6 +12733,7 @@ parsebackq: { | |||
12733 | union node *n; | 12733 | union node *n; |
12734 | char *str; | 12734 | char *str; |
12735 | size_t savelen; | 12735 | size_t savelen; |
12736 | struct heredoc *saveheredoclist; | ||
12736 | smallint saveprompt = 0; | 12737 | smallint saveprompt = 0; |
12737 | 12738 | ||
12738 | str = NULL; | 12739 | str = NULL; |
@@ -12808,6 +12809,9 @@ parsebackq: { | |||
12808 | *nlpp = stzalloc(sizeof(**nlpp)); | 12809 | *nlpp = stzalloc(sizeof(**nlpp)); |
12809 | /* (*nlpp)->next = NULL; - stzalloc did it */ | 12810 | /* (*nlpp)->next = NULL; - stzalloc did it */ |
12810 | 12811 | ||
12812 | saveheredoclist = heredoclist; | ||
12813 | heredoclist = NULL; | ||
12814 | |||
12811 | if (oldstyle) { | 12815 | if (oldstyle) { |
12812 | saveprompt = doprompt; | 12816 | saveprompt = doprompt; |
12813 | doprompt = 0; | 12817 | doprompt = 0; |
@@ -12817,18 +12821,21 @@ parsebackq: { | |||
12817 | 12821 | ||
12818 | if (oldstyle) | 12822 | if (oldstyle) |
12819 | doprompt = saveprompt; | 12823 | doprompt = saveprompt; |
12820 | else if (readtoken() != TRP) | 12824 | else { |
12821 | raise_error_unexpected_syntax(TRP); | 12825 | if (readtoken() != TRP) |
12826 | raise_error_unexpected_syntax(TRP); | ||
12827 | setinputstring(nullstr); | ||
12828 | parseheredoc(); | ||
12829 | } | ||
12830 | |||
12831 | heredoclist = saveheredoclist; | ||
12822 | 12832 | ||
12823 | (*nlpp)->n = n; | 12833 | (*nlpp)->n = n; |
12824 | if (oldstyle) { | 12834 | /* Start reading from old file again. */ |
12825 | /* | 12835 | popfile(); |
12826 | * Start reading from old file again, ignoring any pushed back | 12836 | /* Ignore any pushed back tokens left from the backquote parsing. */ |
12827 | * tokens left from the backquote parsing | 12837 | if (oldstyle) |
12828 | */ | ||
12829 | popfile(); | ||
12830 | tokpushback = 0; | 12838 | tokpushback = 0; |
12831 | } | ||
12832 | while (stackblocksize() <= savelen) | 12839 | while (stackblocksize() <= savelen) |
12833 | growstackblock(); | 12840 | growstackblock(); |
12834 | STARTSTACKSTR(out); | 12841 | STARTSTACKSTR(out); |