diff options
| author | Peter Stephenson <pws@zsh.org> | 2017-05-08 10:54:08 +0100 |
|---|---|---|
| committer | Peter Stephenson <pws@zsh.org> | 2017-05-08 10:54:08 +0100 |
| commit | f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393 (patch) | |
| tree | ce13fa223142a4c22541e6df4aee8ac7b50ae9cf | |
| parent | 41038: Document recent, backwards-compatible precommand modifiers changes. (diff) | |
| download | zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.tar zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.tar.gz zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.tar.bz2 zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.tar.lz zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.tar.xz zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.tar.zst zsh-f25d01a97c61fdac5d6e0a6a8fb63b5b2b5f3393.zip | |
Fix combination of HERE document and |&.
A missing flag setting up the HERE document mean that the size
of the wordcode needed to append the 2>&1 was counted incorrectly,
so the resulting wordcode was garbled.
Add test.
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | Src/parse.c | 2 | ||||
| -rw-r--r-- | Test/A04redirect.ztst | 15 |
3 files changed, 22 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2017-05-08 Peter Stephenson <p.stephenson@samsung.com> + + * 41060: Src/parse.c, Test/A04redirect.ztst: combination + of HERE document and |& was broken by miscounting wordcode owing + to missing flag. + 2017-05-04 Daniel Shahaf <d.s@daniel.shahaf.name> * 41038: NEWS: Document recent, backwards-compatible precommand diff --git a/Src/parse.c b/Src/parse.c index 6fe283dcb..83e87afed 100644 --- a/Src/parse.c +++ b/Src/parse.c @@ -2143,7 +2143,7 @@ par_redir(int *rp, char *idstring) * the definition of WC_REDIR_WORDS. */ ecispace(r, ncodes); *rp = r + ncodes; - ecbuf[r] = WCB_REDIR(type); + ecbuf[r] = WCB_REDIR(type | REDIR_FROM_HEREDOC_MASK); ecbuf[r + 1] = fd1; /* diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst index d7fe22fb0..a5de552c1 100644 --- a/Test/A04redirect.ztst +++ b/Test/A04redirect.ztst @@ -586,3 +586,18 @@ >x >bar >y + + fn-here-pipe() { + cat <<-HERE |& cat + FOO + HERE + } + fn-here-pipe + which fn-here-pipe +0:Combination of HERE-document and |& +>FOO +>fn-here-pipe () { +> cat <<HERE 2>&1 | cat +>FOO +>HERE +>} |
