]> granicus.if.org Git - flex/commitdiff
Fixed POSIXLY_CORRECT detection in scanner.
authorJohn Millaway <john43@users.sourceforge.net>
Fri, 12 Jul 2002 16:21:55 +0000 (16:21 +0000)
committerJohn Millaway <john43@users.sourceforge.net>
Fri, 12 Jul 2002 16:21:55 +0000 (16:21 +0000)
main.c
scan.l

diff --git a/main.c b/main.c
index c0d2142fb8bb9ff15b5b57552140cdaa8946764d..7717637268f1aa96ef9b96b5c30ae656d46ea2b8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1427,12 +1427,12 @@ void readin()
                 * posiz, AND check for conflicting options. How far should we go
                 * with this? Should we disable all the neat-o flex features?
                 */
+        /* Update: Estes says no, since other flex features don't violate posix. */
                }
 
        if ( getenv("POSIXLY_CORRECT") )
                {
                posix_compat = true;
-               /* TODO: See TODO comment above */
                }
 
        if ( backing_up_report )
diff --git a/scan.l b/scan.l
index df8a919173c7d9cdf1ee600164d2977fe4bb56c6..17146c1dc0a9ed574ca9dc8e1a84ae832ba66e0f 100644 (file)
--- a/scan.l
+++ b/scan.l
 #define CHECK_YYMORE(str) \
        if ( all_lower( str ) ) \
                yymore_used = true;
+
+#define YY_USER_INIT \
+       if ( getenv("POSIXLY_CORRECT") ) \
+               posix_compat = true;
+
 %}
 
 %option caseless nodefault stack noyy_top_state