about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-11-17 16:56:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-11-17 16:56:41 +0000
commit0d0e497c693939633fda6cfa0c3269258b8e97ec (patch)
tree20630fa9150130abf2ef12d17a813fc57c7eda90
parent2fbc131ca81470a6b9aa077578f2eb58a7e8e008 (diff)
downloadzsh-0d0e497c693939633fda6cfa0c3269258b8e97ec.tar.gz
zsh-0d0e497c693939633fda6cfa0c3269258b8e97ec.tar.xz
zsh-0d0e497c693939633fda6cfa0c3269258b8e97ec.zip
26056 "< <(...)more_stuff" etc. are errors
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/expn.yo2
-rw-r--r--Src/exec.c7
3 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e3e902d1c..fede2f8e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-11-17  Peter Stephenson  <pws@csr.com>
 
+	* 26056: Doc/Zsh/expn.yo, Src/exec.c:  < <(...)more_stuff is
+	an error and similarly for > >(...)yet_more_stuff.
+
 	* 26055: README, Doc/Zsh/expn.yo, Src/subst.c: ensure process
 	substitution is handled completely before parameter and
 	command substitution.
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 2e5af790c..ec92a34b9 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -362,6 +362,8 @@ or followed by other strings except that, to prevent clashes with
 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)
diff --git a/Src/exec.c b/Src/exec.c
index a398211d3..5aec655a2 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3773,9 +3773,14 @@ getpipe(char *cmd, int nullexec)
     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]);