diff options
author | dgp <dgp@users.sourceforge.net> | 2016-04-04 16:02:17 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2016-04-04 16:02:17 (GMT) |
commit | 92a18f28ec310b2e24249f2f8dc15938b5dbe93e (patch) | |
tree | 0e44d545c109756b846961a538626470a97e0eac /generic | |
parent | 1a7bb8dae4b3d39555102fb6f340f372e4e201da (diff) | |
parent | 8597e498b49956eea6288869eb2e8acdd77fe913 (diff) | |
download | tcl-92a18f28ec310b2e24249f2f8dc15938b5dbe93e.zip tcl-92a18f28ec310b2e24249f2f8dc15938b5dbe93e.tar.gz tcl-92a18f28ec310b2e24249f2f8dc15938b5dbe93e.tar.bz2 |
merge 8.6
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclZlib.c | 9 |
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); |