summaryrefslogtreecommitdiff
path: root/usr.bin/sudo/parse.lex
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/sudo/parse.lex')
-rw-r--r--usr.bin/sudo/parse.lex15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/sudo/parse.lex b/usr.bin/sudo/parse.lex
index 43941ac318e..2c08c32de73 100644
--- a/usr.bin/sudo/parse.lex
+++ b/usr.bin/sudo/parse.lex
@@ -339,17 +339,20 @@ PASSWD[[:blank:]]*: {
return(COMMENT);
} /* return comments */
-<GOTRUNAS,GOTDEFS,GOTCMND,STARTDEFS,INDEFS><<EOF>> {
- BEGIN INITIAL;
- LEXTRACE("EOF ");
- return(ERROR);
- } /* premature EOF */
-
<*>. {
LEXTRACE("ERROR ");
return(ERROR);
} /* parse error */
+<*><<EOF>> {
+ if (YY_START != INITIAL) {
+ BEGIN INITIAL;
+ LEXTRACE("ERROR ");
+ return(ERROR);
+ }
+ yyterminate();
+ }
+
%%
static void
fill(s, len)