From 95eb54d99ce76f84e612ef2ed53daf57dae675f3 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 9 Nov 1999 19:32:41 +0000 Subject: [PATCH] Call YY_FLUSH_BUFFER macro in yywrap() to clean up any buffers that might still exist. Call yyrestart() instead of using the deprecated YY_NEW_FILE macro. --- lex.yy.c | 11 +++++++---- parse.lex | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lex.yy.c b/lex.yy.c index 6a640e620..59c15367d 100644 --- 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(); diff --git a/parse.lex b/parse.lex index fc2be9a63..8aaffdd9a 100644 --- 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(); -- 2.50.1