]> granicus.if.org Git - flex/commitdiff
Improved pipe-stdin hack behavior; resolves sf#198.
authorMichael van Elst <mlelstv@NetBSD.org>
Fri, 8 Jan 2016 20:07:57 +0000 (15:07 -0500)
committerWill Estes <westes575@gmail.com>
Fri, 8 Jan 2016 20:07:57 +0000 (15:07 -0500)
Signed-off-by: Thomas <Klausner wiz@NetBSD.org>
src/filter.c

index aebc2fcb43cad4def08c15366da6b9f6658703d8..c58406df310d9c4775b8a8f36d5ec13a8a5eebab 100644 (file)
@@ -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) {