From: Michael van Elst Date: Fri, 8 Jan 2016 20:07:57 +0000 (-0500) Subject: Improved pipe-stdin hack behavior; resolves sf#198. X-Git-Tag: v2.6.1~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=958ccda44e46a07053a2af0709c7149de0d7250a;p=flex Improved pipe-stdin hack behavior; resolves sf#198. Signed-off-by: Thomas --- 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) {