diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/ChangeLog | 5 | ||||
-rw-r--r-- | support/zlib-helper.c | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/support/ChangeLog b/support/ChangeLog index 74284e404c1..3b2a833dd0b 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,8 @@ +2009-07-21 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * zlib-helper.c: don't try to finish the z_stream if it has not been + used. This fixes all the tests after the latest change. + 2009-07-20 Gonzalo Paniagua Javier <gonzalo@novell.com> * Makefile.am: replaced zlib_macros.c with zlib-helper.c diff --git a/support/zlib-helper.c b/support/zlib-helper.c index 587e06bde8b..41d80407baa 100644 --- a/support/zlib-helper.c +++ b/support/zlib-helper.c @@ -102,10 +102,12 @@ CloseZStream (ZStream *zstream) status = 0; if (zstream->compress) { - status = deflate (zstream->stream, Z_FINISH); - flush_status = Flush (zstream); - if (status == Z_OK || status == Z_STREAM_END) - status = flush_status; + if (zstream->stream->total_out) { + status = deflate (zstream->stream, Z_FINISH); + flush_status = Flush (zstream); + if (status == Z_OK || status == Z_STREAM_END) + status = flush_status; + } deflateEnd (zstream->stream); } else { inflateEnd (zstream->stream); |