Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh parser segmentation fault on taddstr
- X-seq: zsh-workers 41060
 
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
 
- To: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>, zsh-workers@xxxxxxx
 
- Subject: Re: Zsh parser segmentation fault on taddstr
 
- Date: Mon, 08 May 2017 10:37:57 +0100
 
- Cc: Eduardo Bustamante <dualbus@xxxxxxxxx>
 
- Cms-type: 201P
 
- In-reply-to: <20170507213631.2a15e7ad@ntlworld.com>
 
- List-help: <mailto:zsh-workers-help@zsh.org>
 
- List-id: Zsh Workers List <zsh-workers.zsh.org>
 
- List-post: <mailto:zsh-workers@zsh.org>
 
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
 
- Organization: Samsung Cambridge Solution Centre
 
- References:  <CAOSMAut8qq+yfOtH3XfU7oGim4CNN=YV0BxZyhU9k80RQ6khgw@mail.gmail.com> <CGME20170507204410epcas1p1c65248a5ded39eaef91873e43066bd55@epcas1p1.samsung.com> <20170507213631.2a15e7ad@ntlworld.com>
 
On Sun, 7 May 2017 21:36:31 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> % fn() { cat <<y |& cat
> FOO
> y
> }
> % which fn
>  text.c:995: unknown word code in gettext2()
> fn () {
> 	time <<y | cat
> }
This fixes the missing flag that was causing that problem.
pws
diff --git a/Src/parse.c b/Src/parse.c
index 6fe283d..83e87af 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 d7fe22f..a5de552 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
+>}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author