summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 53949a5..b3a6ac2 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -3049,29 +3049,19 @@ ZlibTransformInput(
*errorCodePtr = Tcl_GetErrno();
return -1;
}
- if (readBytes == 0) {
- /*
- * Eof in parent.
- *
- * Now this is a bit different. The partial data waiting is
- * converted and returned.
- */
- if (ResultGenerate(cd, 0, Z_SYNC_FLUSH, errorCodePtr) != TCL_OK) {
- return -1;
- }
-
- } else /* readBytes > 0 */ {
- /*
- * Transform the read chunk, which was not empty. Anything we get
- * back is a transformation result to be put into our buffers, and
- * the next iteration will put it into the result.
- */
+ /*
+ * Transform the read chunk, if not empty. Anything we get
+ * back is a transformation result to be put into our buffers, and
+ * the next iteration will put it into the result.
+ * For the case readBytes is 0 which signaling Eof in parent, the
+ * partial data waiting is converted and returned.
+ */
- if (ResultGenerate(cd, readBytes, Z_NO_FLUSH,
+ if (ResultGenerate(cd, readBytes,
+ (readBytes != 0) ? Z_NO_FLUSH : Z_SYNC_FLUSH,
errorCodePtr) != TCL_OK) {
- return -1;
- }
+ return -1;
}
copyDecompressed: