diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 75b63fbcb1b..083ef0e9a2e 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -257,7 +257,12 @@ tok_nextc(tok) } else { cur = tok->cur - tok->buf; - tok->done = E_OK; + if (feof(tok->fp)) { + tok->done = E_EOF; + done = 1; + } + else + tok->done = E_OK; } tok->lineno++; /* Read until '\n' or EOF */