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.
This commit is contained in:
@@ -339,6 +339,12 @@ PASSWD[[:blank:]]*: {
|
|||||||
return(COMMENT);
|
return(COMMENT);
|
||||||
} /* return comments */
|
} /* return comments */
|
||||||
|
|
||||||
|
<GOTRUNAS,GOTDEFS,GOTCMND,STARTDEFS,INDEFS><<EOF>> {
|
||||||
|
BEGIN INITIAL;
|
||||||
|
LEXTRACE("EOF ");
|
||||||
|
return(ERROR);
|
||||||
|
} /* premature EOF */
|
||||||
|
|
||||||
<*>. {
|
<*>. {
|
||||||
LEXTRACE("ERROR ");
|
LEXTRACE("ERROR ");
|
||||||
return(ERROR);
|
return(ERROR);
|
||||||
|
Reference in New Issue
Block a user