From 78c0535a224697e1c7a1a4e68462d3d204e38942 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 17 Jan 1995 16:12:13 +0000 Subject: [PATCH] fix loop on unterminated triple quotes --- Parser/tokenizer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 */