|
|
@@ -1,38 +1,3 @@
|
|
|
-Index: filter.c
|
|
|
---- filter.c.orig 2003-03-25 17:39:08.000000000 +0100
|
|
|
-+++ filter.c 2004-03-19 14:43:31.317172000 +0100
|
|
|
-@@ -158,10 +158,13 @@
|
|
|
- int r;
|
|
|
-
|
|
|
- /* setup streams again */
|
|
|
-+#ifdef NOTOUCHSTDIO
|
|
|
-- if ((stdin = fdopen (0, "r")) == NULL)
|
|
|
-- flexfatal (_("fdopen(0) failed"));
|
|
|
-- if ((stdout = fdopen (1, "w")) == NULL)
|
|
|
-- flexfatal (_("fdopen(1) failed"));
|
|
|
-+#else
|
|
|
-+ if ((freopen ("/dev/stdin", "r", stdin)) == NULL)
|
|
|
-+ flexfatal (_("freopen(stdin) failed"));
|
|
|
-+ if ((freopen ("/dev/stdout", "w", stdout)) == NULL)
|
|
|
-+ flexfatal (_("freopen(stdout) failed"));
|
|
|
-+#endif
|
|
|
-
|
|
|
- if ((r = chain->filter_func (chain)) == -1)
|
|
|
- flexfatal (_("filter_func failed"));
|
|
|
-@@ -181,8 +188,11 @@
|
|
|
- if (dup2 (pipes[1], 1) == -1)
|
|
|
- flexfatal (_("dup2(pipes[1],1)"));
|
|
|
- close (pipes[1]);
|
|
|
-+#ifdef NOTOUCHSTDIO
|
|
|
-- if ((stdout = fdopen (1, "w")) == NULL)
|
|
|
-- flexfatal (_("fdopen(1) failed"));
|
|
|
-+#else
|
|
|
-+ if ((freopen ("/dev/stdout", "w", stdout)) == NULL)
|
|
|
-+ flexfatal (_("freopen(stdout) failed"));
|
|
|
-+#endif
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
Index: flex.skl
|
|
|
--- flex.skl.orig 2003-04-01 03:51:38.000000000 +0200
|
|
|
+++ flex.skl 2004-02-07 13:21:59.000000000 +0100
|
|
|
@@ -360,3 +325,41 @@ Index: scan.c
|
|
|
case YY_STATE_EOF(INITIAL):
|
|
|
case YY_STATE_EOF(SECT2):
|
|
|
case YY_STATE_EOF(CODEBLOCK):
|
|
|
+Index: filter.c
|
|
|
+--- filter.c.orig 2003-03-25 17:39:08.000000000 +0100
|
|
|
++++ filter.c 2004-03-31 16:55:21.000000000 +0200
|
|
|
+@@ -158,10 +158,21 @@
|
|
|
+ int r;
|
|
|
+
|
|
|
+ /* setup streams again */
|
|
|
++#if 0
|
|
|
+ if ((stdin = fdopen (0, "r")) == NULL)
|
|
|
+ flexfatal (_("fdopen(0) failed"));
|
|
|
+ if ((stdout = fdopen (1, "w")) == NULL)
|
|
|
+ flexfatal (_("fdopen(1) failed"));
|
|
|
++#else
|
|
|
++ /* the above is theoretically correct, but on some
|
|
|
++ platforms (FreeBSD, Solaris, etc) not possible because
|
|
|
++ stdin/stdout/stderr are read-only. Unfortunately there is no
|
|
|
++ standardized alternative except the cheating solution: in most
|
|
|
++ Unix stdio(3) implementations a FILE is nothing more than a C
|
|
|
++ structure referencing a Unix filedescriptor. Hence one can just
|
|
|
++ do nothing as long as the underlying filedescriptor was already
|
|
|
++ changed. */
|
|
|
++#endif
|
|
|
+
|
|
|
+ if ((r = chain->filter_func (chain)) == -1)
|
|
|
+ flexfatal (_("filter_func failed"));
|
|
|
+@@ -181,8 +192,12 @@
|
|
|
+ if (dup2 (pipes[1], 1) == -1)
|
|
|
+ flexfatal (_("dup2(pipes[1],1)"));
|
|
|
+ close (pipes[1]);
|
|
|
++#if 0
|
|
|
+ if ((stdout = fdopen (1, "w")) == NULL)
|
|
|
+ flexfatal (_("fdopen(1) failed"));
|
|
|
++#else
|
|
|
++ /* do just nothing (reason: see above) */
|
|
|
++#endif
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|