summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-04-04 16:02:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-04-04 16:02:17 (GMT)
commite9abd4931802a8067045b1a2adc75356173cb747 (patch)
tree0e44d545c109756b846961a538626470a97e0eac /generic
parentd1bde869dce8d1d410b5aabddeace13133d135fb (diff)
parent1fa8d8f8ed23d263b17cb2315eaf7de803690ee4 (diff)
downloadtcl-e9abd4931802a8067045b1a2adc75356173cb747.zip
tcl-e9abd4931802a8067045b1a2adc75356173cb747.tar.gz
tcl-e9abd4931802a8067045b1a2adc75356173cb747.tar.bz2
merge 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tclZlib.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 50d9a30..691d57a 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -1194,11 +1194,12 @@ Tcl_ZlibStreamPut(
zshPtr->stream.next_out = (Bytef *) dataTmp;
e = deflate(&zshPtr->stream, flush);
- while (e == Z_BUF_ERROR) {
+ while (e == Z_BUF_ERROR || (flush == Z_FINISH && e == Z_OK)) {
/*
- * Output buffer too small to hold the data being generated; so
- * put a new buffer into place after saving the old generated
- * data to the outData list.
+ * Output buffer too small to hold the data being generated or we
+ * are doing the end-of-stream flush (which can spit out masses of
+ * data). This means we need to put a new buffer into place after
+ * saving the old generated data to the outData list.
*/
obj = Tcl_NewByteArrayObj((unsigned char *) dataTmp, outSize);