Patch #1014992: Never return more than a line from readline.

Will backport to 2.3.
This commit is contained in:
Martin v. Löwis 2004-08-25 10:52:58 +00:00
parent 8d494f3241
commit c11d6f13ae
1 changed files with 1 additions and 3 deletions

View File

@ -509,14 +509,12 @@ class ExFileObject(object):
nl = min(nl, size)
else:
size -= len(self.linebuffer)
while nl < 0:
while (nl < 0 and size > 0):
buf = self.read(min(size, 100))
if not buf:
break
self.linebuffer += buf
size -= len(buf)
if size <= 0:
break
nl = self.linebuffer.find("\n")
if nl == -1:
s = self.linebuffer