Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78c0535

Browse files
committed
fix loop on unterminated triple quotes
1 parent 62e376b commit 78c0535

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Parser/tokenizer.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,12 @@ tok_nextc(tok)
257257
}
258258
else {
259259
cur = tok->cur - tok->buf;
260-
tok->done = E_OK;
260+
if (feof(tok->fp)) {
261+
tok->done = E_EOF;
262+
done = 1;
263+
}
264+
else
265+
tok->done = E_OK;
261266
}
262267
tok->lineno++;
263268
/* Read until '\n' or EOF */

0 commit comments

Comments
 (0)