about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-10-10 09:39:17 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-10-10 09:39:17 +0000
commit5f6c22704434f8e98787815764357147b7f87d9f (patch)
treebb0ff3abe8604367324bf3d92f31330ff336f266
parentb1e5dd85179a2ffd2d0235493d40e258847fa596 (diff)
downloadzsh-5f6c22704434f8e98787815764357147b7f87d9f.tar.gz
zsh-5f6c22704434f8e98787815764357147b7f87d9f.tar.xz
zsh-5f6c22704434f8e98787815764357147b7f87d9f.zip
zsh-workers/8184
-rw-r--r--Doc/Zsh/redirect.yo12
-rw-r--r--Src/exec.c4
-rw-r--r--Src/lex.c1
3 files changed, 11 insertions, 6 deletions
diff --git a/Doc/Zsh/redirect.yo b/Doc/Zsh/redirect.yo
index 3f30b75a1..e8fccb36d 100644
--- a/Doc/Zsh/redirect.yo
+++ b/Doc/Zsh/redirect.yo
@@ -77,10 +77,10 @@ item(tt(<<<) var(word))(
 Perform shell expansion on var(word) and pass the result
 to standard input.  This is known as a em(here-string).
 )
-xitem(tt(<&) var(digit))
-item(tt(>&) var(digit))(
+xitem(tt(<&) var(number))
+item(tt(>&) var(number))(
 The standard input/output is duplicated from file descriptor
-var(digit) (see manref(dup)(2)).
+var(number) (see manref(dup2)(2)).
 )
 xitem(tt(<& -))
 item(tt(>& -))(
@@ -90,8 +90,10 @@ xitem(tt(<& p))
 item(tt(>& p))(
 The input/output from/to the coprocess is moved to the standard input/output.
 )
-item(tt(>&) var(word))(
-Same as `tt(>) var(word) tt(2>&1)'.
+xitem(tt(>&) var(word))
+item(tt(&>) var(word))(
+Same as `tt(>) var(word) tt(2>&1)'.  Note that with tt(&>), var(word) is
+never interpreted as a file descriptor, even if it is a number.
 )
 item(tt(>>&) var(word))(
 Same as `tt(>>) var(word) tt(2>&1)'.
diff --git a/Src/exec.c b/Src/exec.c
index ed77497d3..0670148c7 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -877,8 +877,10 @@ execpline(Sublist l, int how, int last1)
     if (how & Z_ASYNC) {
 	lastwj = newjob;
 	jobtab[thisjob].stat |= STAT_NOSTTY;
-	if (l->flags & PFLAG_COPROC)
+	if (l->flags & PFLAG_COPROC) {
 	    zclose(ipipe[1]);
+	    zclose(opipe[0]);
+	}
 	if (how & Z_DISOWN) {
 	    deletejob(jobtab + thisjob);
 	    thisjob = -1;
diff --git a/Src/lex.c b/Src/lex.c
index 069f9b39b..d88e57c22 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -642,6 +642,7 @@ gettok(void)
 	    }
 	    hungetc(d);
 	    lexstop = 0;
+	    tokfd = -1;
 	    return AMPOUTANG;
 	}
 	hungetc(d);