summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-17 16:12:13 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-17 16:12:13 (GMT)
commit78c0535a224697e1c7a1a4e68462d3d204e38942 (patch)
tree9514504bda566a8648f5526d38053311b2c17ecf
parent62e376b164f68ae22ae15610c7642dd920929e38 (diff)
downloadcpython-78c0535a224697e1c7a1a4e68462d3d204e38942.zip
cpython-78c0535a224697e1c7a1a4e68462d3d204e38942.tar.gz
cpython-78c0535a224697e1c7a1a4e68462d3d204e38942.tar.bz2
fix loop on unterminated triple quotes
-rw-r--r--Parser/tokenizer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 75b63fb..083ef0e 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 */