diff options
author | sebres <sebres@users.sourceforge.net> | 2020-04-16 14:05:24 (GMT) |
---|---|---|
committer | sebres <sebres@users.sourceforge.net> | 2020-04-16 14:05:24 (GMT) |
commit | fb7b5ca9d3d2253238c7a1923dcb211d5cdee7fb (patch) | |
tree | a05a8b4dafdaab5b2039453b83eed9097aa424ef | |
parent | 3577e36e79a96a06a2d61bb7c773987768fccdbb (diff) | |
download | tcl-fb7b5ca9d3d2253238c7a1923dcb211d5cdee7fb.zip tcl-fb7b5ca9d3d2253238c7a1923dcb211d5cdee7fb.tar.gz tcl-fb7b5ca9d3d2253238c7a1923dcb211d5cdee7fb.tar.bz2 |
small amend combining similar parts
-rw-r--r-- | generic/tclZlib.c | 30 |
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: |