Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: parse error in process substitution
- X-seq: zsh-workers 26056
- From: Peter Stephenson <pws@xxxxxxx>
- To: "Zsh Hackers' List" <zsh-workers@xxxxxxxxxx>
- Subject: Re: parse error in process substitution
- Date: Mon, 17 Nov 2008 16:51:39 +0000
- In-reply-to: <081115201055.ZM13767@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <20081106150224.GA10992@xxxxxxxxxx> <081106082517.ZM27477@xxxxxxxxxxxxxxxxxxxxxx> <20081110082152.GA9563@xxxxxxxxxx> <20081110142850.0add2680@news01> <20081112105241.40c116d9@news01> <20081113210044.4cea912c@pws-pc> <081115201055.ZM13767@xxxxxxxxxxxxxxxxxxxxxx>
On Sat, 15 Nov 2008 20:10:55 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> One last item ... perhaps you can explain what's going on here:
>
> schaefer[518] cat <<(echo foo)what?
> foo
> schaefer[519]
>
> I'm not sure exactly what I expected, but that wasn't it.
This turns it back into an error with a specific message.
Index: Doc/Zsh/expn.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v
retrieving revision 1.99
diff -u -r1.99 expn.yo
--- Doc/Zsh/expn.yo 17 Nov 2008 16:11:30 -0000 1.99
+++ Doc/Zsh/expn.yo 17 Nov 2008 16:47:07 -0000
@@ -362,6 +362,8 @@
commonly occurring strings and patterns, the last
form must occur at the start of a command argument, and the forms
are only expanded when first parsing command or assignment arguments.
+Process substitutions may be used following redirection operators; in this
+case, the substitution must appear with no trailing string.
In the case of the tt(<) or tt(>) forms, the shell runs the commands in
var(list) asynchronously. If the system supports the tt(/dev/fd)
Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.161
diff -u -r1.161 exec.c
--- Src/exec.c 13 Nov 2008 21:18:14 -0000 1.161
+++ Src/exec.c 17 Nov 2008 16:47:07 -0000
@@ -3773,9 +3773,14 @@
int pipes[2], out = *cmd == Inang;
pid_t pid;
struct timeval bgtime;
+ char *ends;
- if (!(prog = parsecmd(cmd, NULL)))
+ if (!(prog = parsecmd(cmd, &ends)))
return -1;
+ if (*ends) {
+ zerr("invalid syntax for process substitution in redirection");
+ return -1;
+ }
mpipe(pipes);
if ((pid = zfork(&bgtime))) {
zclose(pipes[out]);
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author