zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>, zsh-workers@zsh.org
Cc: Eduardo Bustamante <dualbus@gmail.com>
Subject: Re: Zsh parser segmentation fault on taddstr
Date: Mon, 08 May 2017 10:37:57 +0100	[thread overview]
Message-ID: <20170508103757.1a95ee2a@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20170507213631.2a15e7ad@ntlworld.com>

On Sun, 7 May 2017 21:36:31 +0100
Peter Stephenson <p.w.stephenson@ntlworld.com> 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
+>}


  parent reply	other threads:[~2017-05-08  9:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-07 16:45 Eduardo Bustamante
2017-05-07 20:36 ` Peter Stephenson
2017-05-08  1:59   ` Eduardo Bustamante
2017-05-08  9:37   ` Peter Stephenson [this message]
2017-05-08 13:51     ` Eduardo Bustamante

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170508103757.1a95ee2a@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=dualbus@gmail.com \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).