]> granicus.if.org Git - sudo/commitdiff
Call YY_FLUSH_BUFFER macro in yywrap() to clean up any buffers that
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 9 Nov 1999 19:32:41 +0000 (19:32 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 9 Nov 1999 19:32:41 +0000 (19:32 +0000)
might still exist.
Call yyrestart() instead of using the deprecated YY_NEW_FILE macro.

lex.yy.c
parse.lex

index 6a640e620c906621dbdd2619ad69550630664a11..59c15367db115a2180bdedfdf8475156c48917ca 100644 (file)
--- a/lex.yy.c
+++ b/lex.yy.c
@@ -2957,11 +2957,14 @@ fill_args(s, len, addspace)
 int
 yywrap()
 {
-#ifdef YY_NEW_FILE
-    YY_NEW_FILE;
-#endif /* YY_NEW_FILE */
 
-    /* Don't reset the aliases if called by testsudoers. */
+    /* Flush any buffers that might still exist. */
+    YY_FLUSH_BUFFER;
+
+    /* Set file pointer to the beginning so we can re-run the parser. */
+    yyrestart(yyin);
+
+    /* Free space used by the aliases unless called by testsudoers. */
     if (clearaliases)
        reset_aliases();
 
index fc2be9a63c1936b1dadb15a512ea991ea127c9dd..8aaffdd9a1c081d653133223b1c0dc30d0ff0c45 100644 (file)
--- a/parse.lex
+++ b/parse.lex
@@ -415,11 +415,14 @@ fill_args(s, len, addspace)
 int
 yywrap()
 {
-#ifdef YY_NEW_FILE
-    YY_NEW_FILE;
-#endif /* YY_NEW_FILE */
 
-    /* Don't reset the aliases if called by testsudoers. */
+    /* Flush any buffers that might still exist. */
+    YY_FLUSH_BUFFER;
+
+    /* Set file pointer to the beginning so we can re-run the parser. */
+    yyrestart(yyin);
+
+    /* Free space used by the aliases unless called by testsudoers. */
     if (clearaliases)
        reset_aliases();