Skip to content

Commit d97d4fb

Browse files
committed
properly handle the single null-byte file (closes #24022)
1 parent 9be5fff commit d97d4fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Parser/tokenizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ tok_nextc(struct tok_state *tok)
10141014
else {
10151015
tok->done = E_OK;
10161016
tok->inp = strchr(tok->buf, '\0');
1017-
done = tok->inp[-1] == '\n';
1017+
done = tok->inp == tok->buf || tok->inp[-1] == '\n';
10181018
}
10191019
}
10201020
else {

0 commit comments

Comments
 (0)