summaryrefslogtreecommitdiff
path: root/ext/Compress
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-09-24 13:19:10 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-09-24 13:19:10 +0000
commitaa976d0c37399f75e81801ee86455944a2734d9c (patch)
tree09721d5cef09ffa36da47ef35e1ea28a2b49c7a6 /ext/Compress
parent39ec4146638c464b3f1a56d9165efe9b248b765e (diff)
downloadperl-aa976d0c37399f75e81801ee86455944a2734d9c.tar.gz
Upgrade to Compress::Zlib 2.007
p4raw-id: //depot/perl@31953
Diffstat (limited to 'ext/Compress')
-rw-r--r--ext/Compress/Zlib/Changes7
-rw-r--r--ext/Compress/Zlib/README4
-rw-r--r--ext/Compress/Zlib/lib/Compress/Zlib.pm14
-rw-r--r--ext/Compress/Zlib/t/03zlib-v1.t22
-rw-r--r--ext/Compress/Zlib/t/14gzopen.t2
5 files changed, 37 insertions, 12 deletions
diff --git a/ext/Compress/Zlib/Changes b/ext/Compress/Zlib/Changes
index bcc74fbe06..3ee2c936eb 100644
--- a/ext/Compress/Zlib/Changes
+++ b/ext/Compress/Zlib/Changes
@@ -1,6 +1,13 @@
CHANGES
-------
+ 2.007 22 September 20007
+
+ * lib/Compress/Zlib.pm -- 1.x Backward Compatability issues
+ gzclose - documented return value was wrong, should be 0 for ok.
+ gzflush - return value didn't match 1.x, should return 0 if ok.
+ [rt.cpan.org #29215] and Debian bug #440943 http://bugs.debian.org/440943
+
2.006 1 September 20007
* Makefile.PL
diff --git a/ext/Compress/Zlib/README b/ext/Compress/Zlib/README
index 24a8317b49..13f3996868 100644
--- a/ext/Compress/Zlib/README
+++ b/ext/Compress/Zlib/README
@@ -1,9 +1,9 @@
Compress::Zlib
- Version 2.006
+ Version 2.007
- 1st September 2007
+ 22nd September 2007
Copyright (c) 1995-2007 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/Zlib/lib/Compress/Zlib.pm b/ext/Compress/Zlib/lib/Compress/Zlib.pm
index b4b04cd6ba..ec29575b9a 100644
--- a/ext/Compress/Zlib/lib/Compress/Zlib.pm
+++ b/ext/Compress/Zlib/lib/Compress/Zlib.pm
@@ -18,7 +18,7 @@ use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.006';
+$VERSION = '2.007';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -242,8 +242,8 @@ sub Compress::Zlib::gzFile::gzflush
my $gz = $self->[0] ;
my $status = $gz->flush($f) ;
- _save_gzerr($gz);
- return $status ;
+ my $err = _save_gzerr($gz);
+ return $status ? 0 : $err;
}
sub Compress::Zlib::gzFile::gzclose
@@ -252,8 +252,8 @@ sub Compress::Zlib::gzFile::gzclose
my $gz = $self->[0] ;
my $status = $gz->close() ;
- _save_gzerr($gz);
- return ! $status ;
+ my $err = _save_gzerr($gz);
+ return $status ? 0 : $err;
}
sub Compress::Zlib::gzFile::gzeof
@@ -806,7 +806,7 @@ you fully understand the implications of what it does - overuse of C<flush>
can seriously degrade the level of compression achieved. See the C<zlib>
documentation for details.
-Returns 1 on success, 0 on failure.
+Returns 0 on success.
=item B<$offset = $gz-E<gt>gztell() ;>
@@ -831,7 +831,7 @@ Returns 1 on success, 0 on failure.
Closes the compressed file. Any pending data is flushed to the file
before it is closed.
-Returns 1 on success, 0 on failure.
+Returns 0 on success.
=item B<$gz-E<gt>gzsetparams($level, $strategy>
diff --git a/ext/Compress/Zlib/t/03zlib-v1.t b/ext/Compress/Zlib/t/03zlib-v1.t
index 99a80f9ff4..7358f4a5f0 100644
--- a/ext/Compress/Zlib/t/03zlib-v1.t
+++ b/ext/Compress/Zlib/t/03zlib-v1.t
@@ -23,10 +23,10 @@ BEGIN
my $count = 0 ;
if ($] < 5.005) {
- $count = 383 ;
+ $count = 390 ;
}
else {
- $count = 394 ;
+ $count = 401 ;
}
@@ -1168,3 +1168,21 @@ sub trickle
is slurp($name), $data1 . $data2 . $trailing, "got expected data from slurp" ;
is trickle($name), $data1 . $data2 . $trailing, "got expected data from trickle" ;
}
+
+{
+ title "gzclose & gzflush return codes";
+ # rt.29215
+
+ my $lex = new LexFile my $name ;
+ my $data1 = "the is some text";
+ my $status;
+
+ $fil = gzopen($name, "wb") ;
+ ok $fil, "opened first file";
+ is $fil->gzwrite($data1), length $data1, "write data1" ;
+ $status = $fil->gzflush(0xfff);
+ ok $status, "flush not ok" ;
+ is $status, Z_STREAM_ERROR;
+ ok ! $fil->gzflush(), "flush ok" ;
+ ok ! $fil->gzclose(), "Closed";
+}
diff --git a/ext/Compress/Zlib/t/14gzopen.t b/ext/Compress/Zlib/t/14gzopen.t
index 805bb0ddb4..85970d26b8 100644
--- a/ext/Compress/Zlib/t/14gzopen.t
+++ b/ext/Compress/Zlib/t/14gzopen.t
@@ -95,7 +95,7 @@ is $gzerrno, 0;
is $fil->gzwrite($number), $num_len, "gzwrite returned $num_len" ;
is $gzerrno, 0, 'gzerrno is 0';
-ok $fil->gzflush(Z_FINISH) ;
+ok ! $fil->gzflush(Z_FINISH) ;
is $gzerrno, 0, 'gzerrno is 0';