summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-01 22:01:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-01 22:01:16 (GMT)
commitbe7669ae584a678f38b935b2af3c54c5a90c97af (patch)
treec9a5f83e4aff689a4cf7632a98e0a4d00d2e5cd4
parent03fb2f516a013339b34c6bb52abf8df103093aec (diff)
parentac7af4b977dbecc4a95d4335d152756824c6e62d (diff)
downloadtcl-be7669ae584a678f38b935b2af3c54c5a90c97af.zip
tcl-be7669ae584a678f38b935b2af3c54c5a90c97af.tar.gz
tcl-be7669ae584a678f38b935b2af3c54c5a90c97af.tar.bz2
[Bug 3530536]: zlib-7.4 fails on IRIX64
-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]