summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-02-11 08:11:28 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-02-11 08:11:28 (GMT)
commit5245e701247fd4691c197151b9551c65e2af0213 (patch)
tree6a339cf5c457b3d067891bab36bfa3943ac292cc /generic/tclZlib.c
parent88cc8c36e3373ff9265df0f3ff4cb0310104acf0 (diff)
downloadtcl-5245e701247fd4691c197151b9551c65e2af0213.zip
tcl-5245e701247fd4691c197151b9551c65e2af0213.tar.gz
tcl-5245e701247fd4691c197151b9551c65e2af0213.tar.bz2
[Bug 3603553]: Ensure that data gets written to the underlying stream by
compressing transforms when the amount of data to be written is one buffer's-worth; problem was particularly likely to occur when compressing large quantities of not-very-compressible data. Many thanks to Piera Poggio (vampiera) for reporting.
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 47091de..ff887c8 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -3111,7 +3111,7 @@ ZlibTransformOutput(
e = deflate(&cd->outStream, Z_NO_FLUSH);
produced = cd->outAllocated - cd->outStream.avail_out;
- if (e == Z_OK && cd->outStream.avail_out > 0) {
+ if (e == Z_OK && produced > 0) {
if (Tcl_WriteRaw(cd->parent, cd->outBuffer, produced) < 0) {
*errorCodePtr = Tcl_GetErrno();
return -1;