diff options
author | cracauer <cracauer@FreeBSD.org> | 1999-11-05 12:06:30 +0000 |
---|---|---|
committer | cracauer <cracauer@FreeBSD.org> | 1999-11-05 12:06:30 +0000 |
commit | fffcf922ea6e1fdb420b6b23be008ed43c644bb2 (patch) | |
tree | 9b17f045927c696a6041d34ca1dd3f8a3b3be1d0 /bin/sh/eval.c | |
parent | 3ebec0e7c82a2cef65af67bba6017cbffb993d96 (diff) | |
download | FreeBSD-src-fffcf922ea6e1fdb420b6b23be008ed43c644bb2.zip FreeBSD-src-fffcf922ea6e1fdb420b6b23be008ed43c644bb2.tar.gz |
When a backquote command inside a here-document had a pipe with more
than two processes (got that? :-), the stdin fd of the middle
processes that has just been set up was accidetially closed. Don't do
this.
PR: bin/14527
Diffstat (limited to 'bin/sh/eval.c')
-rw-r--r-- | bin/sh/eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index a3c8fcd..701f018 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -499,7 +499,8 @@ evalpipe(n) close(prevfd); } if (pip[1] >= 0) { - close(pip[0]); + if (!prevfd > 0) + close(pip[0]); if (pip[1] != 1) { close(1); copyfd(pip[1], 1); |