summaryrefslogtreecommitdiff
path: root/ext/Compress
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Compress')
-rw-r--r--ext/Compress/IO/Base/Changes9
-rw-r--r--ext/Compress/IO/Base/README6
-rw-r--r--ext/Compress/IO/Base/lib/IO/Compress/Base.pm9
-rw-r--r--ext/Compress/IO/Base/lib/IO/Compress/Base/Common.pm2
-rw-r--r--ext/Compress/IO/Base/lib/IO/Uncompress/AnyUncompress.pm81
-rw-r--r--ext/Compress/IO/Base/lib/IO/Uncompress/Base.pm9
-rw-r--r--ext/Compress/IO/Zlib/Changes8
-rw-r--r--ext/Compress/IO/Zlib/Makefile.PL1
-rw-r--r--ext/Compress/IO/Zlib/README8
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Deflate.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Identity.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Deflate.pm15
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Gzip.pm25
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Gzip/Constants.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/RawDeflate.pm15
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Zip.pm26
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Zip/Constants.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Compress/Zlib/Constants.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Identity.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Inflate.pm2
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/AnyInflate.pm34
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/Gunzip.pm16
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/Inflate.pm16
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/RawInflate.pm16
-rw-r--r--ext/Compress/IO/Zlib/lib/IO/Uncompress/Unzip.pm16
-rw-r--r--ext/Compress/IO/Zlib/t/010examples.t4
-rw-r--r--ext/Compress/IO/Zlib/t/050interop-gzip.t34
-rw-r--r--ext/Compress/Raw/Zlib/Makefile.PL3
-rw-r--r--ext/Compress/Raw/Zlib/README5
-rw-r--r--ext/Compress/Raw/Zlib/Zlib.xs3
-rw-r--r--ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm9
-rw-r--r--ext/Compress/Raw/Zlib/t/02zlib.t13
-rw-r--r--ext/Compress/Zlib/Changes13
-rwxr-xr-xext/Compress/Zlib/Makefile.PL12
-rw-r--r--ext/Compress/Zlib/README4
-rwxr-xr-xext/Compress/Zlib/examples/gzcat7
-rwxr-xr-xext/Compress/Zlib/examples/gzstream3
-rw-r--r--ext/Compress/Zlib/lib/Compress/Zlib.pm16
-rw-r--r--ext/Compress/Zlib/t/14gzopen.t10
39 files changed, 250 insertions, 212 deletions
diff --git a/ext/Compress/IO/Base/Changes b/ext/Compress/IO/Base/Changes
index a3293e3941..fa0d47918f 100644
--- a/ext/Compress/IO/Base/Changes
+++ b/ext/Compress/IO/Base/Changes
@@ -1,6 +1,15 @@
CHANGES
-------
+ 2.000_10 13 March 2006
+
+ * AnyUncompress doesn't assume that IO-Compress-Zlib is installed any
+ more.
+
+ 2.000_09 3 March 2006
+
+ * Released to CPAN.
+
2.000_08 2 March 2006
* Split IO::Compress::Base into its own distribution.
diff --git a/ext/Compress/IO/Base/README b/ext/Compress/IO/Base/README
index 6f06827f70..cef35988e4 100644
--- a/ext/Compress/IO/Base/README
+++ b/ext/Compress/IO/Base/README
@@ -1,9 +1,9 @@
IO::Compress::Base
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
@@ -23,7 +23,7 @@ DESCRIPTION
-----------
-This module is a base class for all IO::Compress and IO::Uncompress
+This module is the base class for all IO::Compress and IO::Uncompress
modules.
diff --git a/ext/Compress/IO/Base/lib/IO/Compress/Base.pm b/ext/Compress/IO/Base/lib/IO/Compress/Base.pm
index 19669e2ada..567ed0b85a 100644
--- a/ext/Compress/IO/Base/lib/IO/Compress/Base.pm
+++ b/ext/Compress/IO/Base/lib/IO/Compress/Base.pm
@@ -20,7 +20,7 @@ use bytes;
our (@ISA, $VERSION, $got_encode);
#@ISA = qw(Exporter IO::File);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
#Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16.
@@ -968,13 +968,9 @@ L<IO::Zlib|IO::Zlib>
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Base> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -983,7 +979,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Base/lib/IO/Compress/Base/Common.pm b/ext/Compress/IO/Base/lib/IO/Compress/Base/Common.pm
index dc6ea418da..d35a9e02fc 100644
--- a/ext/Compress/IO/Base/lib/IO/Compress/Base/Common.pm
+++ b/ext/Compress/IO/Base/lib/IO/Compress/Base/Common.pm
@@ -11,7 +11,7 @@ use File::GlobMapper;
require Exporter;
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS);
@ISA = qw(Exporter);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
@EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput
isaFileGlobString cleanFileGlobString oneTarget
diff --git a/ext/Compress/IO/Base/lib/IO/Uncompress/AnyUncompress.pm b/ext/Compress/IO/Base/lib/IO/Uncompress/AnyUncompress.pm
index a2c4df240a..e39f1e8ac0 100644
--- a/ext/Compress/IO/Base/lib/IO/Uncompress/AnyUncompress.pm
+++ b/ext/Compress/IO/Base/lib/IO/Uncompress/AnyUncompress.pm
@@ -6,25 +6,27 @@ use bytes;
use IO::Compress::Base::Common qw(createSelfTiedObject);
-#use IO::Uncompress::Base ;
-use IO::Uncompress::Gunzip ;
-use IO::Uncompress::Inflate ;
-use IO::Uncompress::RawInflate ;
-use IO::Uncompress::Unzip ;
+use IO::Uncompress::Base ;
BEGIN
{
+ eval { require IO::Uncompress::Adapter::Inflate; import IO::Uncompress::Adapter::Inflate };
eval { require IO::Uncompress::Adapter::Bunzip2; import IO::Uncompress::Adapter::Bunzip2 };
- eval { require IO::Uncompress::Adapter::LZO; import IO::Uncompress::Adapter::LZO };
- eval { require IO::Uncompress::Bunzip2; import IO::Uncompress::Bunzip2 };
- eval { require IO::Uncompress::UnLzop; import IO::Uncompress::UnLzop };
+ eval { require IO::Uncompress::Adapter::LZO; import IO::Uncompress::Adapter::LZO };
+
+ eval { require IO::Uncompress::Bunzip2; import IO::Uncompress::Bunzip2 };
+ eval { require IO::Uncompress::UnLzop; import IO::Uncompress::UnLzop };
+ eval { require IO::Uncompress::Gunzip; import IO::Uncompress::Gunzip };
+ eval { require IO::Uncompress::Inflate; import IO::Uncompress::Inflate };
+ eval { require IO::Uncompress::RawInflate; import IO::Uncompress::RawInflate };
+ eval { require IO::Uncompress::Unzip; import IO::Uncompress::Unzip };
}
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$AnyUncompressError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -72,21 +74,26 @@ sub mkUncomp
my $class = shift ;
my $got = shift ;
+ my $magic ;
+
# try zlib first
- my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
+ if (defined $IO::Uncompress::RawInflate::VERSION )
+ {
+ my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject();
- return $self->saveErrorString(undef, $errstr, $errno)
- if ! defined $obj;
+ return $self->saveErrorString(undef, $errstr, $errno)
+ if ! defined $obj;
- *$self->{Uncomp} = $obj;
-
- my $magic = $self->ckMagic( qw( RawInflate Inflate Gunzip Unzip ) );
+ *$self->{Uncomp} = $obj;
+
+ $magic = $self->ckMagic( qw( RawInflate Inflate Gunzip Unzip ) );
- if ($magic) {
- *$self->{Info} = $self->readHeader($magic)
- or return undef ;
+ if ($magic) {
+ *$self->{Info} = $self->readHeader($magic)
+ or return undef ;
- return 1;
+ return 1;
+ }
}
#foreach my $type ( qw( Bunzip2 UnLzop ) ) {
@@ -158,7 +165,7 @@ __END__
=head1 NAME
-IO::Uncompress::AnyUncompress - Perl interface to read 1950, 1951 & 1952 files/buffers
+IO::Uncompress::AnyUncompress - Uncompress gzip, zip, bzip2 or lzop file/buffer
=head1 SYNOPSIS
@@ -225,11 +232,32 @@ B<WARNING -- This is a Beta release>.
-
This module provides a Perl interface that allows the reading of
-any files/buffers.
+files/buffers that have been compressed with a variety of compression
+libraries.
+
+The formats supported are:
+
+=over 5
+
+=item RFC 1950
+
+=item RFC 1951
+
+=item gzip (RFC 1952)
+
+=item zip
+
+=item bzip2
+
+=item lzop
+
+=back
+
+The module will auto-detect which, if any, of the supported
+compression formats is being used.
+
-For writing 1950, 1951 & 1952 files/buffers, see the companion module IO::Compress::RawDeflate.
@@ -881,13 +909,9 @@ L<IO::Zlib|IO::Zlib>
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::AnyUncompress> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -896,7 +920,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Base/lib/IO/Uncompress/Base.pm b/ext/Compress/IO/Base/lib/IO/Uncompress/Base.pm
index 13b187a7ad..dab3b51bc9 100644
--- a/ext/Compress/IO/Base/lib/IO/Uncompress/Base.pm
+++ b/ext/Compress/IO/Base/lib/IO/Uncompress/Base.pm
@@ -10,7 +10,7 @@ our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
@ISA = qw(Exporter );
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
use constant G_EOF => 0 ;
use constant G_ERR => -1 ;
@@ -1316,13 +1316,9 @@ L<IO::Zlib|IO::Zlib>
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Base> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1331,7 +1327,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/Changes b/ext/Compress/IO/Zlib/Changes
index a677ed4a50..81fa6db79a 100644
--- a/ext/Compress/IO/Zlib/Changes
+++ b/ext/Compress/IO/Zlib/Changes
@@ -1,6 +1,14 @@
CHANGES
-------
+ 2.000_10 13 March 2006
+
+ * Documentation updates.
+
+ 2.000_09 3 March 2006
+
+ * Released to CPAN.
+
2.000_08 2 March 2006
* Split IO::Compress::Zlib into its own distribution.
diff --git a/ext/Compress/IO/Zlib/Makefile.PL b/ext/Compress/IO/Zlib/Makefile.PL
index 027592a8c9..b56eb2869f 100644
--- a/ext/Compress/IO/Zlib/Makefile.PL
+++ b/ext/Compress/IO/Zlib/Makefile.PL
@@ -23,6 +23,7 @@ WriteMakefile(
? (MAN3PODS => {})
: (PREREQ_PM => { 'Compress::Raw::Zlib' => 0,
'IO::Compress::Base' => 0,
+ 'IO::Uncompress::Base' => 0,
$] >= 5.005 && $] < 5.006
? ('File::BSDGlob' => 0)
: () }
diff --git a/ext/Compress/IO/Zlib/README b/ext/Compress/IO/Zlib/README
index 1413bc1c10..15fe35aa8d 100644
--- a/ext/Compress/IO/Zlib/README
+++ b/ext/Compress/IO/Zlib/README
@@ -1,9 +1,9 @@
IO::Compress::Zlib
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
@@ -23,7 +23,7 @@ DESCRIPTION
-----------
-This module provides a Perl interface to allow reading an writing of RFC
+This module provides a Perl interface to allow reading and writing of RFC
1950, 1951, 1952 (i.e. gzip) and zip files/buffers.
@@ -79,7 +79,7 @@ TROUBLESHOOTING
-The t/17isize Test Suite
+The t/020isize Test Suite
------------------------
This test suite checks that IO::Compress::Zlib can cope with gzip files
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Deflate.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Deflate.pm
index 63eb728932..4521f17542 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Deflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Deflate.pm
@@ -9,7 +9,7 @@ use IO::Compress::Base::Common qw(:Status);
use Compress::Raw::Zlib qw(Z_OK Z_FINISH MAX_WBITS) ;
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
sub mkCompObject
{
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Identity.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Identity.pm
index 9bea284722..10315aafe7 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Identity.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Adapter/Identity.pm
@@ -8,7 +8,7 @@ use IO::Compress::Base::Common qw(:Status);
use Compress::Raw::Zlib () ;
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
sub mkCompObject
{
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Deflate.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Deflate.pm
index abcfee01e7..ebc200a6f6 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Deflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Deflate.pm
@@ -15,7 +15,7 @@ use IO::Compress::Base::Common qw(createSelfTiedObject);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$DeflateError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -167,7 +167,9 @@ __END__
=head1 NAME
-IO::Compress::Deflate - Perl interface to write RFC 1950 files/buffers
+
+IO::Compress::Deflate - Write RFC 1950 files/buffers
+
=head1 SYNOPSIS
@@ -573,7 +575,7 @@ This parameter defaults to 0.
-=item -Merge =E<gt> 0|1
+=item Merge =E<gt> 0|1
This option is used to compress input data and append it to an existing
compressed data stream in C<$output>. The end result is a single compressed
@@ -988,13 +990,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Deflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1003,7 +1001,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip.pm
index 0fc8519852..5732a309be 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip.pm
@@ -26,7 +26,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$GzipError = '' ;
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -429,7 +429,9 @@ __END__
=head1 NAME
-IO::Compress::Gzip - Perl interface to write RFC 1952 files/buffers
+
+IO::Compress::Gzip - Write RFC 1952 files/buffers
+
=head1 SYNOPSIS
@@ -591,16 +593,8 @@ See L<File::GlobMapper|File::GlobMapper> for more details.
If the C<$input> parameter is any other type, C<undef> will be returned.
-
In addition, if C<$input> is a simple filename, the default values for
-a number of the gzip header fields created by this function will
-be sourced from that file --
-
-the NAME gzip header field will be populated with
-the filename itself, and the MTIME header field will be set to the
-modification time of the file.
-The intention here is to mirror part of the behaviour of the gzip
-executable.
+the C<Name> and C<Time> options will be sourced from that file.
If you do not want to use these defaults they can be overridden by
explicitly setting the C<Name> and C<Time> options or by setting the
@@ -854,7 +848,7 @@ This parameter defaults to 0.
-=item -Merge =E<gt> 0|1
+=item Merge =E<gt> 0|1
This option is used to compress input data and append it to an existing
compressed data stream in C<$output>. The end result is a single compressed
@@ -1465,13 +1459,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Gzip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1480,7 +1470,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip/Constants.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip/Constants.pm
index 7d046eabf6..496b8ca8c2 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip/Constants.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Gzip/Constants.pm
@@ -9,7 +9,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
@ISA = qw(Exporter);
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/RawDeflate.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/RawDeflate.pm
index 8891a4ab6d..1dcd650f5f 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/RawDeflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/RawDeflate.pm
@@ -16,7 +16,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$RawDeflateError = '';
@ISA = qw(Exporter IO::Compress::Base);
@@ -248,7 +248,9 @@ __END__
=head1 NAME
-IO::Compress::RawDeflate - Perl interface to write RFC 1951 files/buffers
+
+IO::Compress::RawDeflate - Write RFC 1951 files/buffers
+
=head1 SYNOPSIS
@@ -657,7 +659,7 @@ This parameter defaults to 0.
-=item -Merge =E<gt> 0|1
+=item Merge =E<gt> 0|1
This option is used to compress input data and append it to an existing
compressed data stream in C<$output>. The end result is a single compressed
@@ -1072,13 +1074,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Compress::RawDeflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1087,7 +1085,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Zip.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Zip.pm
index 6952bbc816..c714341779 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Zip.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Zip.pm
@@ -13,7 +13,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$ZipError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -299,7 +299,9 @@ __END__
=head1 NAME
-IO::Compress::Zip - Perl interface to write zip files/buffers
+
+IO::Compress::Zip - Write zip files/buffers
+
=head1 SYNOPSIS
@@ -376,8 +378,9 @@ compressed data to files or buffer.
-Note that this module is not intended to be a replacement for the module
+Note that IO::Compress::Zip is not intended to be a replacement for the module
C<Archive::Zip>.
+
The primary aim of this module is not as an archiver, but to provide
streaming write access to zip file files and buffers.
@@ -463,16 +466,8 @@ See L<File::GlobMapper|File::GlobMapper> for more details.
If the C<$input> parameter is any other type, C<undef> will be returned.
-
In addition, if C<$input> is a simple filename, the default values for
-a number of the zip header fields created by this function will
-be sourced from that file --
-
-the NAME gzip header field will be populated with
-the filename itself, and the MTIME header field will be set to the
-modification time of the file.
-The intention here is to mirror part of the behaviour of the
-zip executable.
+the C<Name> and C<Time> options will be sourced from that file.
If you do not want to use these defaults they can be overridden by
explicitly setting the C<Name> and C<Time> options or by setting the
@@ -1108,13 +1103,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Compress::Zip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1123,7 +1114,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Zip/Constants.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Zip/Constants.pm
index 50494924de..336bea9458 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Zip/Constants.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Zip/Constants.pm
@@ -7,7 +7,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names);
-$VERSION = '1.00';
+$VERSION = '2.000_10';
@ISA = qw(Exporter);
diff --git a/ext/Compress/IO/Zlib/lib/IO/Compress/Zlib/Constants.pm b/ext/Compress/IO/Zlib/lib/IO/Compress/Zlib/Constants.pm
index 2bb0f143f2..33df33c534 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Compress/Zlib/Constants.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Compress/Zlib/Constants.pm
@@ -9,7 +9,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
@ISA = qw(Exporter);
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Identity.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Identity.pm
index 30ab72f588..11f325bf9b 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Identity.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Identity.pm
@@ -8,7 +8,7 @@ use IO::Compress::Base::Common qw(:Status);
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
use Compress::Raw::Zlib ();
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Inflate.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
index 4d63442f52..3b15e4998b 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
@@ -8,7 +8,7 @@ use IO::Compress::Base::Common qw(:Status);
use Compress::Raw::Zlib qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
our ($VERSION);
-$VERSION = '2.000_05';
+$VERSION = '2.000_10';
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/AnyInflate.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/AnyInflate.pm
index 0f30931289..38dd36a265 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/AnyInflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/AnyInflate.pm
@@ -21,7 +21,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$AnyInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -123,7 +123,7 @@ __END__
=head1 NAME
-IO::Uncompress::AnyInflate - Perl interface to read RFC 1950, 1951 & 1952 files/buffers
+IO::Uncompress::AnyInflate - Uncompress zlib-based (zip, gzip) file/buffer
=head1 SYNOPSIS
@@ -192,15 +192,32 @@ B<WARNING -- This is a Beta release>.
-
This module provides a Perl interface that allows the reading of
-files/buffers that conform to RFC's 1950, 1951 and 1952.
+files/buffers that have been compressed in a number of formats that use the
+zlib compression library.
+
+The formats supported are
+
+=over 5
+
+=item RFC 1950
+
+=item RFC 1951
+
+=item gzip (RFC 1952)
+
+=item zip
-The module will auto-detect which, if any, of the three supported
+=back
+
+The module will auto-detect which, if any, of the supported
compression formats is being used.
+
+
+
=head1 Functional Interface
A top-level function, C<anyinflate>, is provided to carry out
@@ -940,13 +957,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::AnyInflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -955,7 +968,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Gunzip.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Gunzip.pm
index aefc3c2719..9ebc03be99 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Gunzip.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Gunzip.pm
@@ -27,7 +27,7 @@ Exporter::export_ok_tags('all');
$GunzipError = '';
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
sub new
{
@@ -296,7 +296,9 @@ __END__
=head1 NAME
-IO::Uncompress::Gunzip - Perl interface to read RFC 1952 files/buffers
+
+IO::Uncompress::Gunzip - Read RFC 1952 files/buffers
+
=head1 SYNOPSIS
@@ -373,6 +375,9 @@ For writing RFC 1952 files/buffers, see the companion module IO::Compress::Gzip.
+
+
+
=head1 Functional Interface
A top-level function, C<gunzip>, is provided to carry out
@@ -1112,13 +1117,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Gunzip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1127,7 +1128,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Inflate.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Inflate.pm
index 62c177c013..f250e8a95c 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Inflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Inflate.pm
@@ -13,7 +13,7 @@ use IO::Uncompress::RawInflate ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$InflateError = '';
@ISA = qw( Exporter IO::Uncompress::RawInflate );
@@ -178,7 +178,9 @@ __END__
=head1 NAME
-IO::Uncompress::Inflate - Perl interface to read RFC 1950 files/buffers
+
+IO::Uncompress::Inflate - Read RFC 1950 files/buffers
+
=head1 SYNOPSIS
@@ -255,6 +257,9 @@ For writing RFC 1950 files/buffers, see the companion module IO::Compress::Defla
+
+
+
=head1 Functional Interface
A top-level function, C<inflate>, is provided to carry out
@@ -938,13 +943,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Inflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -953,7 +954,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/RawInflate.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/RawInflate.pm
index 72b1dbbdfd..c4637047ac 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/RawInflate.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/RawInflate.pm
@@ -17,7 +17,7 @@ use IO::Uncompress::Adapter::Inflate ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -331,7 +331,9 @@ __END__
=head1 NAME
-IO::Uncompress::RawInflate - Perl interface to read RFC 1951 files/buffers
+
+IO::Uncompress::RawInflate - Read RFC 1951 files/buffers
+
=head1 SYNOPSIS
@@ -408,6 +410,9 @@ For writing RFC 1951 files/buffers, see the companion module IO::Compress::RawDe
+
+
+
=head1 Functional Interface
A top-level function, C<rawinflate>, is provided to carry out
@@ -1059,13 +1064,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::RawInflate> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1074,7 +1075,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Unzip.pm b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Unzip.pm
index 5e021df870..01e81e7981 100644
--- a/ext/Compress/IO/Zlib/lib/IO/Uncompress/Unzip.pm
+++ b/ext/Compress/IO/Zlib/lib/IO/Uncompress/Unzip.pm
@@ -16,7 +16,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$UnzipError = '';
@ISA = qw(Exporter IO::Uncompress::RawInflate);
@@ -527,7 +527,9 @@ __END__
=head1 NAME
-IO::Uncompress::Unzip - Perl interface to read zip files/buffers
+
+IO::Uncompress::Unzip - Read zip files/buffers
+
=head1 SYNOPSIS
@@ -604,6 +606,9 @@ For writing zip files/buffers, see the companion module IO::Compress::Zip.
+
+
+
=head1 Functional Interface
A top-level function, C<unzip>, is provided to carry out
@@ -1273,13 +1278,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<IO::Uncompress::Unzip> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1288,7 +1289,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/IO/Zlib/t/010examples.t b/ext/Compress/IO/Zlib/t/010examples.t
index 4cc165d7bb..35b8f5af5e 100644
--- a/ext/Compress/IO/Zlib/t/010examples.t
+++ b/ext/Compress/IO/Zlib/t/010examples.t
@@ -30,8 +30,8 @@ BEGIN
my $Inc = join " ", map qq["-I$_"] => @INC;
-#$Inc = '"-MExtUtils::testlib"'
-# if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
+$Inc = '"-MExtUtils::testlib"'
+ if ! $ENV{PERL_CORE} && eval " require ExtUtils::testlib; " ;
my $Perl = ($ENV{'FULLPERL'} or $^X or 'perl') ;
$Perl = qq["$Perl"] if $^O eq 'MSWin32' ;
diff --git a/ext/Compress/IO/Zlib/t/050interop-gzip.t b/ext/Compress/IO/Zlib/t/050interop-gzip.t
index 14f4cf73a8..3d79a5fd89 100644
--- a/ext/Compress/IO/Zlib/t/050interop-gzip.t
+++ b/ext/Compress/IO/Zlib/t/050interop-gzip.t
@@ -18,7 +18,7 @@ BEGIN {
# Check external gzip is available
my $name = 'gzip';
- for my $dir (split ":", $ENV{PATH})
+ for my $dir (reverse split ":", $ENV{PATH})
{
$GZIP = "$dir/$name"
if -x "$dir/$name" ;
@@ -46,14 +46,18 @@ sub readWithGzip
{
my $file = shift ;
+ my $lex = new LexFile my $outfile;
+
my $comp = "$GZIP -dc" ;
- open F, "$comp $file |";
- local $/;
- $_[0] = <F>;
- close F;
+ #diag "$comp $file >$outfile" ;
+
+ system("$comp $file >$outfile") == 0
+ or die "'$comp' failed: $?";
+
+ $_[0] = readFile($outfile);
- return $? ;
+ return 1 ;
}
sub getGzipInfo
@@ -67,14 +71,16 @@ sub writeWithGzip
my $content = shift ;
my $options = shift || '';
+ my $lex = new LexFile my $infile;
+ writeFile($infile, $content);
+
unlink $file ;
- my $gzip = "$GZIP -c $options >$file" ;
+ my $gzip = "$GZIP -c $options $infile >$file" ;
- open F, "| $gzip" ;
- print F $content ;
- close F ;
+ system($gzip) == 0
+ or die "'$gzip' failed: $?";
- return $? ;
+ return 1 ;
}
@@ -87,15 +93,15 @@ sub writeWithGzip
my $content = "hello world\n" ;
my $got;
- is writeWithGzip($file, $content), 0, "writeWithGzip ok";
+ is writeWithGzip($file, $content), 1, "writeWithGzip ok";
gunzip $file => \$got ;
- is $got, $content;
+ is $got, $content, "got content";
gzip \$content => $file1;
$got = '';
- is readWithGzip($file1, $got), 0, "readWithGzip returns 0";
+ is readWithGzip($file1, $got), 1, "readWithGzip ok";
is $got, $content, "got content";
}
diff --git a/ext/Compress/Raw/Zlib/Makefile.PL b/ext/Compress/Raw/Zlib/Makefile.PL
index 1b8ab2e838..a5a89c5766 100644
--- a/ext/Compress/Raw/Zlib/Makefile.PL
+++ b/ext/Compress/Raw/Zlib/Makefile.PL
@@ -329,8 +329,7 @@ sub zlib_files
-my @GZIP_OS_Names ;
-my %OSnames ;
+use vars qw ( @GZIP_OS_Names %OSnames) ;
BEGIN
{
diff --git a/ext/Compress/Raw/Zlib/README b/ext/Compress/Raw/Zlib/README
index a84265e658..0d6e868c1e 100644
--- a/ext/Compress/Raw/Zlib/README
+++ b/ext/Compress/Raw/Zlib/README
@@ -1,9 +1,9 @@
Compress::Raw::Zlib
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
@@ -79,7 +79,6 @@ To install Compress::Raw::Zlib, run the command below:
-
Controlling the version of zlib used by Compress::Raw::Zlib
----------------------------------------------------------
diff --git a/ext/Compress/Raw/Zlib/Zlib.xs b/ext/Compress/Raw/Zlib/Zlib.xs
index 3f7f6e668b..9fc4e37722 100644
--- a/ext/Compress/Raw/Zlib/Zlib.xs
+++ b/ext/Compress/Raw/Zlib/Zlib.xs
@@ -1862,7 +1862,8 @@ resetLastBlockByte(s, byte)
#ifndef MAGIC_APPEND
croak("resetLastBlockByte needs zlib 1.2.1 or better");
#else
- *byte = *byte ^ (1 << ((8 - s->window_lastbit) & 7));
+ if (byte != NULL)
+ *byte = *byte ^ (1 << ((8 - s->window_lastbit) & 7));
#endif
diff --git a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm
index 65a95977e7..d282bad721 100644
--- a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm
+++ b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm
@@ -13,7 +13,7 @@ use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.000_08';
+$VERSION = '2.000_10';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -1177,13 +1177,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<Compress::Raw::Zlib> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1192,7 +1188,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 2005-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/Raw/Zlib/t/02zlib.t b/ext/Compress/Raw/Zlib/t/02zlib.t
index bb972af03b..ef4aef5987 100644
--- a/ext/Compress/Raw/Zlib/t/02zlib.t
+++ b/ext/Compress/Raw/Zlib/t/02zlib.t
@@ -24,13 +24,13 @@ BEGIN
my $count = 0 ;
if ($] < 5.005) {
- $count = 188 ;
+ $count = 189 ;
}
elsif ($] >= 5.006) {
- $count = 242 ;
+ $count = 243 ;
}
else {
- $count = 200 ;
+ $count = 201 ;
}
plan tests => $count + $extra;
@@ -720,6 +720,13 @@ if ($] >= 5.005)
}
+{
+ # regression - check that resetLastBlockByte can cope with a NULL
+ # pointer.
+ Compress::Raw::Zlib::InflateScan->new->resetLastBlockByte(undef);
+ ok 1, "resetLastBlockByte(undef) is ok" ;
+}
+
exit if $] < 5.006 ;
title 'Looping Append test with substr output - substr the end of the string';
diff --git a/ext/Compress/Zlib/Changes b/ext/Compress/Zlib/Changes
index ec29cfeab4..e63ff55884 100644
--- a/ext/Compress/Zlib/Changes
+++ b/ext/Compress/Zlib/Changes
@@ -1,11 +1,18 @@
CHANGES
-------
- 2.000_08 2 March 2006
+ 2.000_10 13 March 2006
+
+ * Changed gzread so that its behaviour matches C::Z::gzread 1.x if it
+ is called after eof. In this case it will write an empty string
+ into the output parameter. This change is solely for backward
+ compatability reasons.
- * Moved the IO::* modules out into their own distributions.
+ 2.000_09 3 March 2006
- 2.000_08 9 January 2006
+ * Posted to CPAN
+
+ 2.000_08 2 March 2006
* Breakout zlib specific code into separate modules.
diff --git a/ext/Compress/Zlib/Makefile.PL b/ext/Compress/Zlib/Makefile.PL
index 63c8bce450..df93a6cbb7 100755
--- a/ext/Compress/Zlib/Makefile.PL
+++ b/ext/Compress/Zlib/Makefile.PL
@@ -21,10 +21,14 @@ WriteMakefile(
(
$ENV{SKIP_FOR_CORE}
? (MAN3PODS => {})
- : (PREREQ_PM => { 'Compress::Raw::Zlib' => 0,
- 'IO::Compress::Base' => 0,
- 'IO::Compress::Zlib' => 0,
- 'Scalar::Util' => 0,
+ : (PREREQ_PM => { 'Compress::Raw::Zlib' => 0,
+ 'IO::Compress::Base' => 0,
+ 'IO::Compress::Base::Common' => 0,
+ 'IO::Uncompress::Base' => 0,
+ 'IO::Compress::Gzip' => 0,
+ 'IO::Compress::Gzip::Constants' => 0,
+ 'IO::Uncompress::Gunzip' => 0,
+ 'Scalar::Util' => 0,
}
)
),
diff --git a/ext/Compress/Zlib/README b/ext/Compress/Zlib/README
index 1a1c253c85..003d535628 100644
--- a/ext/Compress/Zlib/README
+++ b/ext/Compress/Zlib/README
@@ -1,9 +1,9 @@
Compress::Zlib
- Version 2.000_08
+ Version 2.000_10
- 27 Feb 2006
+ 13 Mar 2006
Copyright (c) 1995-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/Zlib/examples/gzcat b/ext/Compress/Zlib/examples/gzcat
index 3bbd2972c9..5241a5a11f 100755
--- a/ext/Compress/Zlib/examples/gzcat
+++ b/ext/Compress/Zlib/examples/gzcat
@@ -15,11 +15,8 @@ my $filename ;
foreach my $filename (@ARGV) {
my $buffer ;
- my $file = $filename ;
- $file = \*STDIN if $file eq '-' ;
-
- my $gz = gzopen($file, "rb")
- or die "Cannot open $file: $gzerrno\n" ;
+ my $gz = gzopen($filename, "rb")
+ or die "Cannot open $filename: $gzerrno\n" ;
print $buffer while $gz->gzread($buffer) > 0 ;
diff --git a/ext/Compress/Zlib/examples/gzstream b/ext/Compress/Zlib/examples/gzstream
index cb03a2c0fc..faacb0a0dd 100755
--- a/ext/Compress/Zlib/examples/gzstream
+++ b/ext/Compress/Zlib/examples/gzstream
@@ -7,7 +7,8 @@ use Compress::Zlib ;
binmode STDOUT; # gzopen only sets it on the fd
-my $gz = gzopen(\*STDOUT, "wb")
+#my $gz = gzopen(\*STDOUT, "wb")
+my $gz = gzopen('-', "wb")
or die "Cannot open stdout: $gzerrno\n" ;
while (<>) {
diff --git a/ext/Compress/Zlib/lib/Compress/Zlib.pm b/ext/Compress/Zlib/lib/Compress/Zlib.pm
index 9e65ecd3af..00f8244f12 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.000_08';
+$VERSION = '2.000_10';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -158,11 +158,14 @@ sub Compress::Zlib::gzFile::gzread
return _set_gzerr(Z_STREAM_ERROR())
if $self->[1] ne 'inflate';
- return 0 if $self->gzeof();
+ if ($self->gzeof()) {
+ # Zap the output buffer to match ver 1 behaviour.
+ $_[0] = "" ;
+ return 0 ;
+ }
my $gz = $self->[0] ;
my $status = $gz->read($_[0], defined $_[1] ? $_[1] : 4096) ;
- $_[0] = "" if ! defined $_[0] ;
_save_gzerr($gz, 1);
return $status ;
}
@@ -1436,13 +1439,9 @@ The primary site for gzip is F<http://www.gzip.org>.
-
-
-
=head1 AUTHOR
-The I<Compress::Zlib> module was written by Paul Marquess,
-F<pmqs@cpan.org>.
+This module was written by Paul Marquess, F<pmqs@cpan.org>.
@@ -1451,7 +1450,6 @@ F<pmqs@cpan.org>.
See the Changes file.
=head1 COPYRIGHT AND LICENSE
-
Copyright (c) 1995-2006 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/Zlib/t/14gzopen.t b/ext/Compress/Zlib/t/14gzopen.t
index 97f0a1cb78..d4a3a0d993 100644
--- a/ext/Compress/Zlib/t/14gzopen.t
+++ b/ext/Compress/Zlib/t/14gzopen.t
@@ -20,7 +20,7 @@ BEGIN {
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 208 + $extra ;
+ plan tests => 210 + $extra ;
use_ok('Compress::Zlib', 2) ;
use_ok('IO::Compress::Gzip::Constants') ;
@@ -70,9 +70,17 @@ is $fil->gzread($uncomp), $len;
is $fil->gztell(), $len;
ok $fil->gzeof() ;
+
+# gzread after eof bahavior
+
+my $xyz = "123" ;
+is $fil->gzread($xyz), 0, "gzread returns 0 on eof" ;
+is $xyz, "", "gzread on eof zaps the output buffer [Match 1,x behavior]" ;
+
ok ! $fil->gzclose ;
ok $fil->gzeof() ;
+
1 while unlink $name ;
ok $hello eq $uncomp ;