Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-21 14:36:47 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-07-21 14:36:47 +0400
commit90f189686710b608c7dcc961d8ce04460e3f3c78 (patch)
tree1a6cb8a8f467a052327d58b7d4655d5b31fb8dcd /support
parentb08aa45a2b16716607fab801a6f5d1dad9435785 (diff)
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. svn path=/trunk/mono/; revision=138272
Diffstat (limited to 'support')
-rw-r--r--support/ChangeLog5
-rw-r--r--support/zlib-helper.c10
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);