mirror of https://github.com/python/cpython
properly handle the single null-byte file (closes #24022)
This commit is contained in:
parent
354c2f90a1
commit
26d998cfdd
|
@ -1014,7 +1014,7 @@ tok_nextc(struct tok_state *tok)
|
|||
else {
|
||||
tok->done = E_OK;
|
||||
tok->inp = strchr(tok->buf, '\0');
|
||||
done = tok->inp[-1] == '\n';
|
||||
done = tok->inp == tok->buf || tok->inp[-1] == '\n';
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue