summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--doc/zlib.n7
-rw-r--r--generic/tclZlib.c1
-rw-r--r--tests/zlib.test16
4 files changed, 28 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 81bf5e9..46c1b78f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-31 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tclZlib.c: [Bug 3530536]: zlib-7.4 fails on IRIX64
+ * tests/zlib.test:
+ * doc/zlib.n: Document that [stream checksum] doesn't do
+ what's expected for "inflate" and "deflate" formats
+
2012-05-31 Donal K. Fellows <dkf@users.sf.net>
* library/safe.tcl (safe::AliasFileSubcommand): Don't assume that
diff --git a/doc/zlib.n b/doc/zlib.n
index 9fa83c6..a4ff7f8 100644
--- a/doc/zlib.n
+++ b/doc/zlib.n
@@ -200,9 +200,10 @@ data corruption.
.TP
\fB\-checksum\fR
.
-This read-only option, valid for both compressing and decompressing
-transforms, gets the current checksum for the uncompressed data that the
-compression engine has seen so far. The compression algorithm depends on what
+This read-only option gets the current checksum for the uncompressed data
+that the compression engine has seen so far. It is valid for both
+compressing and decompressing transforms, but not for the raw inflate
+and deflate formats. The compression algorithm depends on what
format is being produced or consumed.
.TP
\fB\-header\fR
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 84a81f8..0ff8b50 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -537,6 +537,7 @@ Tcl_ZlibStreamInit(
zshPtr->currentInput = NULL;
zshPtr->streamEnd = 0;
memset(&zshPtr->stream, 0, sizeof(z_stream));
+ zshPtr->stream.adler = 1;
/*
* No output buffer available yet
diff --git a/tests/zlib.test b/tests/zlib.test
index 4ed5b33..8212082 100644
--- a/tests/zlib.test
+++ b/tests/zlib.test
@@ -103,6 +103,22 @@ test zlib-7.4 {zlib stream} zlib {
$s close
lappend result $data
} {{} 1 abcdeEDCBA}
+test zlib-7.5 {zlib stream} zlib {
+ set s [zlib stream gzip]
+ $s put -finalize abcdeEDCBA..
+ set data [$s get]
+ set result [list [$s get] [format %x [$s checksum]]]
+ $s close
+ lappend result [zlib gunzip $data]
+} {{} 69f34b6a abcdeEDCBA..}
+test zlib-7.6 {zlib stream} zlib {
+ set s [zlib stream gunzip]
+ $s put -finalize [zlib gzip abcdeEDCBA..]
+ set data [$s get]
+ set result [list [$s get] [format %x [$s checksum]]]
+ $s close
+ lappend result $data
+} {{} 69f34b6a abcdeEDCBA..}
test zlib-8.1 {zlib transformation} -constraints zlib -setup {
set file [makeFile {} test.gz]