summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-01-06 23:50:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-01-06 23:50:00 +0000
commitb9a34c5667d63a7c1002cfd7bffb55f36dbdb15d (patch)
tree526ae92829fdc643a8c7e20beaed7417c333fe9c /usr.bin
parent1ef58f232139e2f6fb4419f789338e370a26b6b0 (diff)
Work around what appears to be a flex bug when dealing with files
that lack a final newline before EOF. This adds a rule to match EOF in the non-initial states which resets the state to INITIAL and throws an error.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sudo/parse.lex6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/sudo/parse.lex b/usr.bin/sudo/parse.lex
index 773be1b109e..43941ac318e 100644
--- a/usr.bin/sudo/parse.lex
+++ b/usr.bin/sudo/parse.lex
@@ -339,6 +339,12 @@ PASSWD[[:blank:]]*: {
return(COMMENT);
} /* return comments */
+<GOTRUNAS,GOTDEFS,GOTCMND,STARTDEFS,INDEFS><<EOF>> {
+ BEGIN INITIAL;
+ LEXTRACE("EOF ");
+ return(ERROR);
+ } /* premature EOF */
+
<*>. {
LEXTRACE("ERROR ");
return(ERROR);