mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 00:51:05 +02:00
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.
This commit is contained in:
parent
aa8157b463
commit
f25d01a97c
3 changed files with 22 additions and 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>
|
2017-05-04 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||||
|
|
||||||
* 41038: NEWS: Document recent, backwards-compatible precommand
|
* 41038: NEWS: Document recent, backwards-compatible precommand
|
||||||
|
|
|
||||||
|
|
@ -2143,7 +2143,7 @@ par_redir(int *rp, char *idstring)
|
||||||
* the definition of WC_REDIR_WORDS. */
|
* the definition of WC_REDIR_WORDS. */
|
||||||
ecispace(r, ncodes);
|
ecispace(r, ncodes);
|
||||||
*rp = r + ncodes;
|
*rp = r + ncodes;
|
||||||
ecbuf[r] = WCB_REDIR(type);
|
ecbuf[r] = WCB_REDIR(type | REDIR_FROM_HEREDOC_MASK);
|
||||||
ecbuf[r + 1] = fd1;
|
ecbuf[r + 1] = fd1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -586,3 +586,18 @@
|
||||||
>x
|
>x
|
||||||
>bar
|
>bar
|
||||||
>y
|
>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
|
||||||
|
>}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue