]> granicus.if.org Git - flex/commitdiff
fix yywrap behavior for reentrant scanners
authorWill Estes <wlestes@users.sourceforge.net>
Sun, 5 Feb 2012 23:28:54 +0000 (23:28 +0000)
committerWill Estes <wlestes@users.sourceforge.net>
Sun, 5 Feb 2012 23:28:54 +0000 (23:28 +0000)
main.c

diff --git a/main.c b/main.c
index 493c636fa70184d73ed5beeb6011744d63f251b6..fef16f400c3d35f5e9ed82e19285c799743f2827 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1578,9 +1578,11 @@ void readin ()
     }
 
        if (!do_yywrap) {
-               if (!C_plus_plus) {
-                       outn ("\n#define yywrap() 1");
-               }
+               if (!C_plus_plus)
+                        if (reentrant)
+                               outn ("\n#define yywrap(yyscanner) 1");
+                        else
+                               outn ("\n#define yywrap() 1");
                outn ("#define YY_SKIP_YYWRAP");
        }