From: Guido van Rossum Date: Wed, 18 Mar 1998 17:59:20 +0000 (+0000) Subject: Subtle fix in the read() code which could cause a read broken up in X-Git-Tag: v1.5.1~335 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=240c35aac081c35b4b746ba43b09c13dce2f6f71;p=thirdparty%2FPython%2Fcpython.git Subtle fix in the read() code which could cause a read broken up in several pieces to fail... --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index d07aa69e61e4..51752abc1312 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -469,7 +469,7 @@ file_read(f, args) if (bytesread < buffersize) break; if (bytesrequested < 0) { - buffersize = new_buffersize(f, buffersize); + buffersize = bytesread + new_buffersize(f, buffersize); if (_PyString_Resize(&v, buffersize) < 0) return NULL; }