]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1014992: Never return more than a line from readline.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 25 Aug 2004 10:53:30 +0000 (10:53 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 25 Aug 2004 10:53:30 +0000 (10:53 +0000)
Lib/tarfile.py
Misc/NEWS

index 327ba365e60553c5ee36bb5f35242422b6f84946..38c50b205e9bb86099d773c0943958eeb49e46f0 100644 (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
index fa41a18c682c81cf4f653ec582f54e1897a33a5c..f64e33a4718200b08c9675c915735cbeb83f10f2 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -51,6 +51,8 @@ Extension modules
 Library
 -------
 
+- Patch #1014992: In tarfile.readline, never return more than a line.
+
 - Bug #1013882: Flush bz2 data even if nothing had been written so far.
 
 - Patch #997284: Allow pydoc to work with XP Themes (.manifest file)