diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-09-19 06:41:11 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-09-19 06:41:11 (GMT) |
commit | 26d998cfdd1f843a154e5398d09c0270fa17aa30 (patch) | |
tree | 296a49f0685db3c945d9a2d8106414c54742ad18 /Parser/tokenizer.c | |
parent | 354c2f90a15a62005f8a67d1077c4bebaa9df06b (diff) | |
download | cpython-26d998cfdd1f843a154e5398d09c0270fa17aa30.zip cpython-26d998cfdd1f843a154e5398d09c0270fa17aa30.tar.gz cpython-26d998cfdd1f843a154e5398d09c0270fa17aa30.tar.bz2 |
properly handle the single null-byte file (closes #24022)
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 1540d26..1a8cf40 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -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 { |