summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael van Elst <mlelstv@NetBSD.org>2016-01-08 15:07:57 -0500
committerWill Estes <westes575@gmail.com>2016-01-08 15:07:57 -0500
commit958ccda44e46a07053a2af0709c7149de0d7250a (patch)
tree1f882434298b38ff9836fa49498348e5e09bd07f
parent3efb40df0ec5cddf0cb63a7900eb88258c478514 (diff)
Improved pipe-stdin hack behavior; resolves sf#198.
Signed-off-by: Thomas <Klausner wiz@NetBSD.org>
-rw-r--r--src/filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/filter.c b/src/filter.c
index aebc2fc..c58406d 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -167,6 +167,8 @@ clearerr(stdin);
flexfatal (_("dup2(pipes[0],0)"));
close (pipes[0]);
fseek (stdin, 0, SEEK_CUR);
+ ungetc(' ', stdin); /* still an evil hack, but one that works better */
+ (void)fgetc(stdin); /* on NetBSD than the fseek attempt does */
/* run as a filter, either internally or by exec */
if (chain->filter_func) {