cmd/yacc: correctly detect end of file in gettok
This prevents an infinite loop. Change-Id: I7eda6b9d032ca0daeb24b555954330d07f35c78b
This commit is contained in:
parent
eb4aea5072
commit
bf59f0ed28
1 changed files with 2 additions and 0 deletions
|
|
@ -1805,6 +1805,8 @@ begin:
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
return c;
|
return c;
|
||||||
|
if(c == Beof)
|
||||||
|
return ENDFILE;
|
||||||
Bungetrune(finput);
|
Bungetrune(finput);
|
||||||
}
|
}
|
||||||
tokname[i] = 0;
|
tokname[i] = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue