summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST5
-rw-r--r--ext/Compress/Raw/Zlib/Changes5
-rw-r--r--ext/Compress/Raw/Zlib/Makefile.PL1
-rw-r--r--ext/Compress/Raw/Zlib/README4
-rw-r--r--ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm2
-rw-r--r--ext/Compress/Zlib/Changes5
-rwxr-xr-xext/Compress/Zlib/Makefile.PL24
-rw-r--r--ext/Compress/Zlib/README4
-rw-r--r--ext/Compress/Zlib/lib/Compress/Zlib.pm28
-rw-r--r--ext/Compress/Zlib/t/08encoding.t65
-rw-r--r--ext/IO_Compress_Base/Changes14
-rw-r--r--ext/IO_Compress_Base/README4
-rw-r--r--ext/IO_Compress_Base/lib/IO/Compress/Base.pm10
-rw-r--r--ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm2
-rw-r--r--ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm32
-rw-r--r--ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm52
-rw-r--r--ext/IO_Compress_Zlib/Changes13
-rw-r--r--ext/IO_Compress_Zlib/Makefile.PL18
-rw-r--r--ext/IO_Compress_Zlib/README4
-rw-r--r--ext/IO_Compress_Zlib/examples/unzip12
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm6
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm4
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm10
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm12
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm2
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm12
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm24
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm2
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm2
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm4
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm6
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm6
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm18
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm14
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm8
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm10
-rw-r--r--ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm16
-rw-r--r--ext/IO_Compress_Zlib/t/004gziphdr.t2
-rw-r--r--ext/IO_Compress_Zlib/t/005defhdr.t4
-rw-r--r--ext/IO_Compress_Zlib/t/110encode-deflate.t21
-rw-r--r--ext/IO_Compress_Zlib/t/110encode-gzip.t21
-rw-r--r--ext/IO_Compress_Zlib/t/110encode-rawdeflate.t21
-rw-r--r--ext/IO_Compress_Zlib/t/110encode-zip.t21
-rw-r--r--t/lib/compress/encode.pl123
-rw-r--r--t/lib/compress/generic.pl58
-rw-r--r--t/lib/compress/oneshot.pl2
-rw-r--r--t/lib/compress/tied.pl6
47 files changed, 561 insertions, 178 deletions
diff --git a/MANIFEST b/MANIFEST
index 330ab54cc8..a9bdfa44ec 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -795,6 +795,10 @@ ext/IO_Compress_Zlib/t/109merge-deflate.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/109merge-gzip.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/109merge-rawdeflate.t IO::Compress::Zlib
ext/IO_Compress_Zlib/t/109merge-zip.t IO::Compress::Zlib
+ext/IO_Compress_Zlib/t/110encode-deflate.t IO::Compress::Zlib
+ext/IO_Compress_Zlib/t/110encode-gzip.t IO::Compress::Zlib
+ext/IO_Compress_Zlib/t/110encode-rawdeflate.t IO::Compress::Zlib
+ext/IO_Compress_Zlib/t/110encode-zip.t IO::Compress::Zlib
ext/IO/hints/sco.pl Hint for IO for named architecture
ext/IO/IO.pm Top-level interface to IO::* classes
ext/IO/IO.xs IO extension external subroutines
@@ -3425,6 +3429,7 @@ t/lib/compress/any.pl Compress::Zlib
t/lib/compress/anyunc.pl Compress::Zlib
t/lib/compress/CompTestUtils.pm Compress::Zlib
t/lib/compress/destroy.pl Compress::Zlib
+t/lib/compress/encode.pl Compress::Zlib
t/lib/compress/generic.pl Compress::Zlib
t/lib/compress/merge.pl Compress::Zlib
t/lib/compress/multi.pl Compress::Zlib
diff --git a/ext/Compress/Raw/Zlib/Changes b/ext/Compress/Raw/Zlib/Changes
index ef8ddab889..ffd51a30b2 100644
--- a/ext/Compress/Raw/Zlib/Changes
+++ b/ext/Compress/Raw/Zlib/Changes
@@ -1,6 +1,11 @@
CHANGES
-------
+ 2.005 18 June 2007
+
+ * Only include ppport.h when not being built with perl.
+ [core patch #30655]
+
2.004 3 March 2007
* Fixed lvalue substr issue
diff --git a/ext/Compress/Raw/Zlib/Makefile.PL b/ext/Compress/Raw/Zlib/Makefile.PL
index e151ac9afc..3eb400624c 100644
--- a/ext/Compress/Raw/Zlib/Makefile.PL
+++ b/ext/Compress/Raw/Zlib/Makefile.PL
@@ -82,7 +82,6 @@ WriteMakefile(
: ()
),
-
(
$BUILD_ZLIB
? zlib_files($ZLIB_LIB)
diff --git a/ext/Compress/Raw/Zlib/README b/ext/Compress/Raw/Zlib/README
index 35bd1c2f4e..523f3b312e 100644
--- a/ext/Compress/Raw/Zlib/README
+++ b/ext/Compress/Raw/Zlib/README
@@ -1,9 +1,9 @@
Compress::Raw::Zlib
- Version 2.004
+ Version 2.005
- 3rd March 2007
+ 18th June 2007
Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
diff --git a/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm b/ext/Compress/Raw/Zlib/lib/Compress/Raw/Zlib.pm
index 02ff3d1668..5a0098b5c6 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.004_01';
+$VERSION = '2.005';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
diff --git a/ext/Compress/Zlib/Changes b/ext/Compress/Zlib/Changes
index 8c02d4b653..eff627b37d 100644
--- a/ext/Compress/Zlib/Changes
+++ b/ext/Compress/Zlib/Changes
@@ -1,6 +1,11 @@
CHANGES
-------
+ 2.005 18 June 2007
+
+ * Added info about removing Compress::Zlib version 1, before
+ installing version 2.
+
2.004 3 March 2007
* rewrote memGzip using IO::Compress::Gzip::gzip
diff --git a/ext/Compress/Zlib/Makefile.PL b/ext/Compress/Zlib/Makefile.PL
index a7e3a6ad7c..f09008e663 100755
--- a/ext/Compress/Zlib/Makefile.PL
+++ b/ext/Compress/Zlib/Makefile.PL
@@ -3,11 +3,12 @@
use strict ;
require 5.004 ;
-$::VERSION = '2.004' ;
+$::VERSION = '2.005' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
+
UpDowngrade(getPerlFiles('MANIFEST'))
unless $ENV{PERL_CORE};
@@ -47,5 +48,26 @@ WriteMakefile(
) ;
+# Check for Compress::Zlib version 1.
+eval "require Compress::Zlib; " ;
+if ( ! $ENV{PERL_CORE} && ! $@ && $Compress::Zlib::VERSION < 2)
+{
+ my $ver = $Compress::Zlib::VERSION ;
+ print <<EOM
+
+I see you already have Compress::Zlib version $ver installed.
+Version 1 MUST be removed for version 2 to operate correctly.
+
+The easiest way to do that is to install Compress::Zlib like this
+
+ make install UNINST=1
+
+If you run the CPAN shell run this before installing Compress::Zlib
+
+ o conf make_install_arg UNINST=1
+
+EOM
+}
+
# end of file Makefile.PL
diff --git a/ext/Compress/Zlib/README b/ext/Compress/Zlib/README
index 7d2f0de374..8a36799cee 100644
--- a/ext/Compress/Zlib/README
+++ b/ext/Compress/Zlib/README
@@ -1,9 +1,9 @@
Compress::Zlib
- Version 2.004
+ Version 2.005
- 3rd March 2007
+ 18th June 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 fe1892653b..e10763232e 100644
--- a/ext/Compress/Zlib/lib/Compress/Zlib.pm
+++ b/ext/Compress/Zlib/lib/Compress/Zlib.pm
@@ -8,17 +8,17 @@ use Carp ;
use IO::Handle ;
use Scalar::Util qw(dualvar);
-use IO::Compress::Base::Common 2.004 ;
-use Compress::Raw::Zlib 2.004 ;
-use IO::Compress::Gzip 2.004 ;
-use IO::Uncompress::Gunzip 2.004 ;
+use IO::Compress::Base::Common 2.005 ;
+use Compress::Raw::Zlib 2.005 ;
+use IO::Compress::Gzip 2.005 ;
+use IO::Uncompress::Gunzip 2.005 ;
use strict ;
use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, $AUTOLOAD);
-$VERSION = '2.004';
+$VERSION = '2.005';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
@@ -193,6 +193,9 @@ sub Compress::Zlib::gzFile::gzwrite
return _set_gzerr(Z_STREAM_ERROR())
if $self->[1] ne 'deflate';
+ $] >= 5.008 and (utf8::downgrade($_[0], 1)
+ or croak "Wide character in gzwrite");
+
my $status = $gz->write($_[0]) ;
_save_gzerr($gz);
return $status ;
@@ -301,6 +304,9 @@ sub compress($;$)
$in = \$_[0] ;
}
+ $] >= 5.008 and (utf8::downgrade($$in, 1)
+ or croak "Wide character in compress");
+
my $level = (@_ == 2 ? $_[1] : Z_DEFAULT_COMPRESSION() );
$x = new Compress::Raw::Zlib::Deflate -AppendOutput => 1, -Level => $level
@@ -328,6 +334,9 @@ sub uncompress($)
$in = \$_[0] ;
}
+ $] >= 5.008 and (utf8::downgrade($$in, 1)
+ or croak "Wide character in uncompress");
+
$x = new Compress::Raw::Zlib::Inflate -ConsumeInput => 0 or return undef ;
$err = $x->inflate($in, $output) ;
@@ -438,7 +447,7 @@ sub inflate
package Compress::Zlib ;
-use IO::Compress::Gzip::Constants 2.004 ;
+use IO::Compress::Gzip::Constants 2.005 ;
sub memGzip($)
{
@@ -447,6 +456,9 @@ sub memGzip($)
# if the deflation buffer isn't a reference, make it one
my $string = (ref $_[0] ? $_[0] : \$_[0]) ;
+ $] >= 5.008 and (utf8::downgrade($$string, 1)
+ or croak "Wide character in memGzip");
+
IO::Compress::Gzip::gzip($string, \$out, Minimal => 1)
or return undef ;
@@ -518,6 +530,9 @@ sub memGunzip($)
# if the buffer isn't a reference, make it one
my $string = (ref $_[0] ? $_[0] : \$_[0]);
+ $] >= 5.008 and (utf8::downgrade($$string, 1)
+ or croak "Wide character in memGunzip");
+
_removeGzipHeader($string) == Z_OK()
or return undef;
@@ -1443,3 +1458,4 @@ modify it under the same terms as Perl itself.
+
diff --git a/ext/Compress/Zlib/t/08encoding.t b/ext/Compress/Zlib/t/08encoding.t
index 3ebbfbbca6..f377609e57 100644
--- a/ext/Compress/Zlib/t/08encoding.t
+++ b/ext/Compress/Zlib/t/08encoding.t
@@ -28,7 +28,7 @@ BEGIN
$extra = 1
if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 };
- plan tests => 16 + $extra ;
+ plan tests => 29 + $extra ;
use_ok('Compress::Zlib', 2);
}
@@ -41,30 +41,32 @@ is Compress::Zlib::zlib_version, ZLIB_VERSION,
"ZLIB_VERSION matches Compress::Zlib::zlib_version" ;
-if(0)
{
+ title "memGzip" ;
# length of this string is 2 characters
my $s = "\x{df}\x{100}";
- my $cs = Compress::Zlib::memGzip($s);
+ my $cs = Compress::Zlib::memGzip(Encode::encode_utf8($s));
# length stored at end of gzip file should be 4
my ($crc, $len) = unpack ("VV", substr($cs, -8, 8));
- is $len, 4, "length is 4";
+ is $len, 4, " length is 4";
}
{
- title "memGzip" ;
- # length of this string is 2 characters
- my $s = "\x{df}\x{100}";
+ title "memGunzip when compressed gzip has been encoded" ;
+ my $s = "hello world" ;
- my $cs = Compress::Zlib::memGzip(Encode::encode_utf8($s));
+ my $co = Compress::Zlib::memGzip($s);
+ is Compress::Zlib::memGunzip(my $x = $co), $s, " match uncompressed";
- # length stored at end of gzip file should be 4
- my ($crc, $len) = unpack ("VV", substr($cs, -8, 8));
-
- is $len, 4, " length is 4";
+ utf8::upgrade($co);
+
+ my $un = Compress::Zlib::memGunzip($co);
+ ok $un, " got uncompressed";
+
+ is $un, $s, " uncompressed matched original";
}
{
@@ -73,23 +75,17 @@ if(0)
my $s = "\x{df}\x{100}";
my $s_copy = $s ;
- #my $cs = compress($s);
my $ces = compress(Encode::encode_utf8($s_copy));
ok $ces, " compressed ok" ;
- #is $s, $ces ;
-
- #my $un = uncompress($cs);
- #is $un, $s;
-
my $un = Encode::decode_utf8(uncompress($ces));
- #my $un = uncompress($ces);
is $un, $s, " decode_utf8 ok";
- #$un = Encode::decode_utf8(uncompress($cs));
- #is $un, $s;
-
+ utf8::upgrade($ces);
+ $un = Encode::decode_utf8(uncompress($ces));
+ is $un, $s, " decode_utf8 ok";
+
}
{
@@ -116,5 +112,28 @@ if(0)
is $s, Encode::decode_utf8($uncomp), " decode_utf8 ok" ;
}
-# Add tests that check that the module traps use of wide chars
+{
+ title "Catch wide characters";
+
+ my $a = "a\xFF\x{100}";
+ eval { Compress::Zlib::memGzip($a) };
+ like($@, qr/Wide character in memGzip/, " wide characters in memGzip");
+
+ eval { Compress::Zlib::memGunzip($a) };
+ like($@, qr/Wide character in memGunzip/, " wide characters in memGunzip");
+
+ eval { Compress::Zlib::compress($a) };
+ like($@, qr/Wide character in compress/, " wide characters in compress");
+
+ eval { Compress::Zlib::uncompress($a) };
+ like($@, qr/Wide character in uncompress/, " wide characters in uncompress");
+
+ my $lex = new LexFile my $name ;
+ ok my $fil = gzopen($name, "wb"), " gzopen for write ok" ;
+
+ eval { $fil->gzwrite($a); } ;
+ like($@, qr/Wide character in gzwrite/, " wide characters in gzwrite");
+
+ ok ! $fil->gzclose, " gzclose ok" ;
+}
diff --git a/ext/IO_Compress_Base/Changes b/ext/IO_Compress_Base/Changes
index 24e88f0616..4d0068b738 100644
--- a/ext/IO_Compress_Base/Changes
+++ b/ext/IO_Compress_Base/Changes
@@ -1,6 +1,20 @@
CHANGES
-------
+ 2.005 18 June 2007
+
+ * Stephen Turner reported a problem when using IO::Uncompress::Gunzip
+ with XML::Parser. Turns out there were two issues.
+
+ Firstly an IO::Uncompress object isn't an IO::Handle. It is now.
+
+ Secondly the implementation of "read" wasn't honouring this
+
+ SCALAR will be grown or shrunk to the length actually read.
+
+ In particular it didn't do the right thing on EOF.
+ This has been fixed.
+
2.004 3 March 2007
* Made seek less wasteful of memory.
diff --git a/ext/IO_Compress_Base/README b/ext/IO_Compress_Base/README
index 1e557c97e6..c499ea2014 100644
--- a/ext/IO_Compress_Base/README
+++ b/ext/IO_Compress_Base/README
@@ -1,9 +1,9 @@
IO::Compress::Base
- Version 2.004
+ Version 2.005
- 3rd March 2007
+ 18th June 2007
Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
diff --git a/ext/IO_Compress_Base/lib/IO/Compress/Base.pm b/ext/IO_Compress_Base/lib/IO/Compress/Base.pm
index 8617b5630f..901d35119b 100644
--- a/ext/IO_Compress_Base/lib/IO/Compress/Base.pm
+++ b/ext/IO_Compress_Base/lib/IO/Compress/Base.pm
@@ -6,7 +6,7 @@ require 5.004 ;
use strict ;
use warnings;
-use IO::Compress::Base::Common 2.004 ;
+use IO::Compress::Base::Common 2.005 ;
use IO::File ;
use Scalar::Util qw(blessed readonly);
@@ -18,9 +18,9 @@ use Symbol;
use bytes;
our (@ISA, $VERSION);
-#@ISA = qw(Exporter IO::File);
+@ISA = qw(Exporter IO::File);
-$VERSION = '2.004';
+$VERSION = '2.005';
#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.
@@ -574,6 +574,9 @@ sub syswrite
$buffer = \$_[0] ;
}
+ $] >= 5.008 and ( utf8::downgrade($$buffer, 1)
+ or croak "Wide character in " . *$self->{ClassName} . "::write:");
+
if (@_ > 1) {
my $slen = defined $$buffer ? length($$buffer) : 0;
@@ -985,3 +988,4 @@ This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
+
diff --git a/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm b/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm
index 9c0b6fd880..faef2ab5c5 100644
--- a/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm
+++ b/ext/IO_Compress_Base/lib/IO/Compress/Base/Common.pm
@@ -11,7 +11,7 @@ use File::GlobMapper;
require Exporter;
our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE);
@ISA = qw(Exporter);
-$VERSION = '2.004';
+$VERSION = '2.005';
@EXPORT = qw( isaFilehandle isaFilename whatIsInput whatIsOutput
isaFileGlobString cleanFileGlobString oneTarget
diff --git a/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm b/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm
index 923aa839c5..f129224141 100644
--- a/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm
+++ b/ext/IO_Compress_Base/lib/IO/Uncompress/AnyUncompress.pm
@@ -4,16 +4,16 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.005 qw(createSelfTiedObject);
-use IO::Uncompress::Base 2.004 ;
+use IO::Uncompress::Base 2.005 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyUncompressError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$AnyUncompressError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -27,18 +27,18 @@ Exporter::export_ok_tags('all');
BEGIN
{
- eval ' use IO::Uncompress::Adapter::Inflate 2.004 ;';
- eval ' use IO::Uncompress::Adapter::Bunzip2 2.004 ;';
- eval ' use IO::Uncompress::Adapter::LZO 2.004 ;';
- eval ' use IO::Uncompress::Adapter::Lzf 2.004 ;';
-
- eval ' use IO::Uncompress::Bunzip2 2.004 ;';
- eval ' use IO::Uncompress::UnLzop 2.004 ;';
- eval ' use IO::Uncompress::Gunzip 2.004 ;';
- eval ' use IO::Uncompress::Inflate 2.004 ;';
- eval ' use IO::Uncompress::RawInflate 2.004 ;';
- eval ' use IO::Uncompress::Unzip 2.004 ;';
- eval ' use IO::Uncompress::UnLzf 2.004 ;';
+ eval ' use IO::Uncompress::Adapter::Inflate 2.005 ;';
+ eval ' use IO::Uncompress::Adapter::Bunzip2 2.005 ;';
+ eval ' use IO::Uncompress::Adapter::LZO 2.005 ;';
+ eval ' use IO::Uncompress::Adapter::Lzf 2.005 ;';
+
+ eval ' use IO::Uncompress::Bunzip2 2.005 ;';
+ eval ' use IO::Uncompress::UnLzop 2.005 ;';
+ eval ' use IO::Uncompress::Gunzip 2.005 ;';
+ eval ' use IO::Uncompress::Inflate 2.005 ;';
+ eval ' use IO::Uncompress::RawInflate 2.005 ;';
+ eval ' use IO::Uncompress::Unzip 2.005 ;';
+ eval ' use IO::Uncompress::UnLzf 2.005 ;';
}
sub new
@@ -56,7 +56,7 @@ sub anyuncompress
sub getExtraParams
{
- use IO::Compress::Base::Common 2.004 qw(:Parse);
+ use IO::Compress::Base::Common 2.005 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
diff --git a/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm b/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm
index 1563dbab2c..71321e0d80 100644
--- a/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm
+++ b/ext/IO_Compress_Base/lib/IO/Uncompress/Base.pm
@@ -6,16 +6,15 @@ use warnings;
use bytes;
our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS);
-#@ISA = qw(Exporter IO::File);
-@ISA = qw(Exporter );
+@ISA = qw(Exporter IO::File);
-$VERSION = '2.004';
+$VERSION = '2.005';
use constant G_EOF => 0 ;
use constant G_ERR => -1 ;
-use IO::Compress::Base::Common 2.004 ;
+use IO::Compress::Base::Common 2.005 ;
#use Parse::Parameters ;
use IO::File ;
@@ -974,14 +973,9 @@ sub read
my $self = shift ;
return G_EOF if *$self->{Closed} ;
- return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
my $buffer ;
- #$self->croakError(*$self->{ClassName} .
- # "::read: buffer parameter is read-only")
- # if Compress::Raw::Zlib::_readonly_ref($_[0]);
-
if (ref $_[0] ) {
$self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only")
if readonly(${ $_[0] });
@@ -1000,6 +994,22 @@ sub read
my $length = $_[1] ;
my $offset = $_[2] || 0;
+ if (! *$self->{AppendOutput}) {
+ if (! $offset) {
+ $$buffer = '' ;
+ }
+ else {
+ if ($offset > length($$buffer)) {
+ $$buffer .= "\x00" x ($offset - length($$buffer));
+ }
+ else {
+ substr($$buffer, $offset) = '';
+ }
+ }
+ }
+
+ return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ;
+
# the core read will return 0 if asked for 0 bytes
return 0 if defined $length && $length == 0 ;
@@ -1008,8 +1018,6 @@ sub read
$self->croakError(*$self->{ClassName} . "::read: length parameter is negative")
if $length < 0 ;
- $$buffer = '' unless *$self->{AppendOutput} || $offset ;
-
# Short-circuit if this is a simple read, with no length
# or offset specified.
unless ( $length || $offset) {
@@ -1031,6 +1039,7 @@ sub read
# or both are specified.
my $out_buffer = *$self->{Pending} ;
+
while (! *$self->{EndStream} && length($out_buffer) < $length)
{
my $buf_len = $self->_raw_read(\$out_buffer);
@@ -1044,21 +1053,18 @@ sub read
return 0
if $length == 0 ;
+ $$buffer = ''
+ if ! defined $$buffer;
+
+ $offset = length $$buffer
+ if *$self->{AppendOutput} ;
+
*$self->{Pending} = $out_buffer;
$out_buffer = \*$self->{Pending} ;
- if ($offset) {
- $$buffer .= "\x00" x ($offset - length($$buffer))
- if $offset > length($$buffer) ;
- #substr($$buffer, $offset) = substr($$out_buffer, 0, $length, '') ;
- substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ;
- substr($$out_buffer, 0, $length) = '' ;
- }
- else {
- #$$buffer .= substr($$out_buffer, 0, $length, '') ;
- $$buffer .= substr($$out_buffer, 0, $length) ;
- substr($$out_buffer, 0, $length) = '' ;
- }
+ #substr($$buffer, $offset) = substr($$out_buffer, 0, $length, '') ;
+ substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ;
+ substr($$out_buffer, 0, $length) = '' ;
return $length ;
}
diff --git a/ext/IO_Compress_Zlib/Changes b/ext/IO_Compress_Zlib/Changes
index e5c95f87a3..bf3d78ee13 100644
--- a/ext/IO_Compress_Zlib/Changes
+++ b/ext/IO_Compress_Zlib/Changes
@@ -1,6 +1,19 @@
CHANGES
-------
+ 2.005 18 June 2007
+
+ * IO::Compress::Gzip & IO::Uncompress::Gunzip
+
+ - RFC1952 says that the FNAME & FCOMMENT header fields must be ISO
+ 8859-1 (LATIN-1) characters. The code can optionally police this.
+ Added a fix for this logic when running on EBCDIC.
+
+ * Makefile.PL
+
+ - Check if IO::Compress::Bzip2 is already installed. If it is, add
+ to the PREREQ_PM list.
+
2.004 3 March 2007
* IO::Compress::Zip
diff --git a/ext/IO_Compress_Zlib/Makefile.PL b/ext/IO_Compress_Zlib/Makefile.PL
index 4d38fc7fa9..9bffb07afc 100644
--- a/ext/IO_Compress_Zlib/Makefile.PL
+++ b/ext/IO_Compress_Zlib/Makefile.PL
@@ -3,7 +3,7 @@
use strict ;
require 5.004 ;
-$::VERSION = '2.004' ;
+$::VERSION = '2.005' ;
use private::MakeUtil;
use ExtUtils::MakeMaker 5.16 ;
@@ -11,6 +11,18 @@ use ExtUtils::MakeMaker 5.16 ;
UpDowngrade(getPerlFiles('MANIFEST'))
unless $ENV{PERL_CORE};
+my @MainPREREQ = qw(Compress::Raw::Zlib
+ IO::Compress::Base
+ IO::Uncompress::Base
+ );
+
+# Bzip2 is an option prereq.
+push @MainPREREQ, qw(IO::Compress::Bzip2 IO::Uncompress::Bunzip2)
+ if eval { require IO::Compress::Bzip2; };
+
+my %MainPREREQ = map { $_ => $::VERSION } @MainPREREQ;
+
+
WriteMakefile(
NAME => 'IO::Compress::Zlib',
VERSION_FROM => 'lib/IO/Compress/Gzip.pm',
@@ -23,9 +35,7 @@ WriteMakefile(
(
$ENV{SKIP_FOR_CORE}
? (MAN3PODS => {})
- : (PREREQ_PM => { 'Compress::Raw::Zlib' => $::VERSION,
- 'IO::Compress::Base' => $::VERSION,
- 'IO::Uncompress::Base' => $::VERSION,
+ : (PREREQ_PM => { %MainPREREQ,
$] >= 5.005 && $] < 5.006
? ('File::BSDGlob' => 0)
: () }
diff --git a/ext/IO_Compress_Zlib/README b/ext/IO_Compress_Zlib/README
index d0e48d4248..2622fa003b 100644
--- a/ext/IO_Compress_Zlib/README
+++ b/ext/IO_Compress_Zlib/README
@@ -1,9 +1,9 @@
IO::Compress::Zlib
- Version 2.004
+ Version 2.005
- 3rd March 2007
+ 18th June 2007
Copyright (c) 2005-2007 Paul Marquess. All rights reserved.
diff --git a/ext/IO_Compress_Zlib/examples/unzip b/ext/IO_Compress_Zlib/examples/unzip
index 417a9d28a8..0623253db0 100644
--- a/ext/IO_Compress_Zlib/examples/unzip
+++ b/ext/IO_Compress_Zlib/examples/unzip
@@ -2,10 +2,13 @@
use strict;
use warnings;
+use File::Path;
+use File::Basename;
use IO::File;
-use IO::Uncompress::RawInflate qw(rawinflate $RawInflateError);
+use IO::Uncompress::RawInflate qw(:all);
-die "Usage: zipcat file"
+
+die "Usage: zipcat file\n"
if @ARGV != 1 ;
my $file = $ARGV[0] ;
@@ -53,9 +56,10 @@ while ()
warn "Writing file '$filename' $compressedMethod\n";
- mkpath basename $filename;
+ #mkpath dirname $filename;
- rawinflate $fh => $filename,
+ #rawinflate $fh => $filename,
+ rawinflate $fh => '-',
Transparent => 1,
InputLength => $compressedLength
or die "Error uncompressing $file [$filename]: $RawInflateError\n" ;
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm
index 1937c7ccbe..dfeb20b486 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Deflate.pm
@@ -4,12 +4,12 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(:Status);
+use IO::Compress::Base::Common 2.005 qw(:Status);
-use Compress::Raw::Zlib 2.004 qw(Z_OK Z_FINISH MAX_WBITS) ;
+use Compress::Raw::Zlib 2.005 qw(Z_OK Z_FINISH MAX_WBITS) ;
our ($VERSION);
-$VERSION = '2.004';
+$VERSION = '2.005';
sub mkCompObject
{
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm
index 596b670d4c..cb52223141 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Adapter/Identity.pm
@@ -4,10 +4,10 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(:Status);
+use IO::Compress::Base::Common 2.005 qw(:Status);
our ($VERSION);
-$VERSION = '2.004';
+$VERSION = '2.005';
sub mkCompObject
{
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm
index 0015505a54..8ec541b155 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Deflate.pm
@@ -6,16 +6,16 @@ use bytes;
require Exporter ;
-use IO::Compress::RawDeflate 2.004 ;
+use IO::Compress::RawDeflate 2.005 ;
-use Compress::Raw::Zlib 2.004 ;
-use IO::Compress::Zlib::Constants 2.004 ;
-use IO::Compress::Base::Common 2.004 qw(createSelfTiedObject);
+use Compress::Raw::Zlib 2.005 ;
+use IO::Compress::Zlib::Constants 2.005 ;
+use IO::Compress::Base::Common 2.005 qw(createSelfTiedObject);
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $DeflateError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$DeflateError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm
index 5d1656447d..f1b801b205 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip.pm
@@ -8,12 +8,12 @@ use warnings;
use bytes;
-use IO::Compress::RawDeflate 2.004 ;
+use IO::Compress::RawDeflate 2.005 ;
-use Compress::Raw::Zlib 2.004 ;
-use IO::Compress::Base::Common 2.004 qw(:Status :Parse createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.004 ;
-use IO::Compress::Zlib::Extra 2.004 ;
+use Compress::Raw::Zlib 2.005 ;
+use IO::Compress::Base::Common 2.005 qw(:Status :Parse createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.005 ;
+use IO::Compress::Zlib::Extra 2.005 ;
BEGIN
{
@@ -27,7 +27,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GzipError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$GzipError = '' ;
@ISA = qw(Exporter IO::Compress::RawDeflate);
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm
index c1e4e5794e..6992357f44 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Gzip/Constants.pm
+++ b/ext/IO_Compress_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.004';
+$VERSION = '2.005';
@ISA = qw(Exporter);
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm
index 11a2ae37df..d3900db6c7 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/RawDeflate.pm
@@ -7,16 +7,16 @@ use warnings;
use bytes;
-use IO::Compress::Base 2.004 ;
-use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
-use IO::Compress::Adapter::Deflate 2.004 ;
+use IO::Compress::Base 2.005 ;
+use IO::Compress::Base::Common 2.005 qw(:Status createSelfTiedObject);
+use IO::Compress::Adapter::Deflate 2.005 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$RawDeflateError = '';
@ISA = qw(Exporter IO::Compress::Base);
@@ -141,8 +141,8 @@ sub getZlibParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.004 qw(:Parse);
- use Compress::Raw::Zlib 2.004 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.005 qw(:Parse);
+ use Compress::Raw::Zlib 2.005 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
return (
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm
index 143760e3d5..4ba7e6f4fd 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip.pm
@@ -4,21 +4,21 @@ use strict ;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
-use IO::Compress::RawDeflate 2.004 ;
-use IO::Compress::Adapter::Deflate 2.004 ;
-use IO::Compress::Adapter::Identity 2.004 ;
-use IO::Compress::Zlib::Extra 2.004 ;
-use IO::Compress::Zip::Constants 2.004 ;
+use IO::Compress::Base::Common 2.005 qw(:Status createSelfTiedObject);
+use IO::Compress::RawDeflate 2.005 ;
+use IO::Compress::Adapter::Deflate 2.005 ;
+use IO::Compress::Adapter::Identity 2.005 ;
+use IO::Compress::Zlib::Extra 2.005 ;
+use IO::Compress::Zip::Constants 2.005 ;
-use Compress::Raw::Zlib 2.004 qw(crc32) ;
+use Compress::Raw::Zlib 2.005 qw(crc32) ;
BEGIN
{
eval { require IO::Compress::Adapter::Bzip2 ;
- import IO::Compress::Adapter::Bzip2 2.004 ;
+ import IO::Compress::Adapter::Bzip2 2.005 ;
require IO::Compress::Bzip2 ;
- import IO::Compress::Bzip2 2.004 ;
+ import IO::Compress::Bzip2 2.005 ;
} ;
}
@@ -27,7 +27,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $ZipError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$ZipError = '';
@ISA = qw(Exporter IO::Compress::RawDeflate);
@@ -441,8 +441,8 @@ sub getExtraParams
{
my $self = shift ;
- use IO::Compress::Base::Common 2.004 qw(:Parse);
- use Compress::Raw::Zlib 2.004 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
+ use IO::Compress::Base::Common 2.005 qw(:Parse);
+ use Compress::Raw::Zlib 2.005 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY);
my @Bzip2 = ();
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm
index b0505d6c40..f1338a629a 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zip/Constants.pm
@@ -7,7 +7,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT, %ZIP_CM_MIN_VERSIONS);
-$VERSION = '2.004';
+$VERSION = '2.005';
@ISA = qw(Exporter);
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm
index 492b2e3ddd..980d1269f7 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Constants.pm
@@ -9,7 +9,7 @@ require Exporter;
our ($VERSION, @ISA, @EXPORT);
-$VERSION = '2.004';
+$VERSION = '2.005';
@ISA = qw(Exporter);
diff --git a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm
index 4034e3a481..bd7ac2ec8f 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Compress/Zlib/Extra.pm
@@ -8,9 +8,9 @@ use bytes;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS);
-$VERSION = '2.004';
+$VERSION = '2.005';
-use IO::Compress::Gzip::Constants 2.004 ;
+use IO::Compress::Gzip::Constants 2.005 ;
sub ExtraFieldError
{
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm
index 36b9fbbce3..1e506124ac 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Identity.pm
@@ -4,13 +4,13 @@ use warnings;
use strict;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(:Status);
+use IO::Compress::Base::Common 2.005 qw(:Status);
our ($VERSION);
-$VERSION = '2.004';
+$VERSION = '2.005';
-use Compress::Raw::Zlib 2.004 ();
+use Compress::Raw::Zlib 2.005 ();
sub mkUncompObject
{
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
index 6131c14140..2a7125d143 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Adapter/Inflate.pm
@@ -4,11 +4,11 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(:Status);
-use Compress::Raw::Zlib 2.004 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
+use IO::Compress::Base::Common 2.005 qw(:Status);
+use Compress::Raw::Zlib 2.005 qw(Z_OK Z_DATA_ERROR Z_STREAM_END Z_FINISH MAX_WBITS);
our ($VERSION);
-$VERSION = '2.004';
+$VERSION = '2.005';
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm
index 04c53ba7e6..8e5544eb16 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/AnyInflate.pm
@@ -6,22 +6,22 @@ use strict;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(createSelfTiedObject);
+use IO::Compress::Base::Common 2.005 qw(createSelfTiedObject);
-use IO::Uncompress::Adapter::Inflate 2.004 ();
+use IO::Uncompress::Adapter::Inflate 2.005 ();
-use IO::Uncompress::Base 2.004 ;
-use IO::Uncompress::Gunzip 2.004 ;
-use IO::Uncompress::Inflate 2.004 ;
-use IO::Uncompress::RawInflate 2.004 ;
-use IO::Uncompress::Unzip 2.004 ;
+use IO::Uncompress::Base 2.005 ;
+use IO::Uncompress::Gunzip 2.005 ;
+use IO::Uncompress::Inflate 2.005 ;
+use IO::Uncompress::RawInflate 2.005 ;
+use IO::Uncompress::Unzip 2.005 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $AnyInflateError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$AnyInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
@@ -48,7 +48,7 @@ sub anyinflate
sub getExtraParams
{
- use IO::Compress::Base::Common 2.004 qw(:Parse);
+ use IO::Compress::Base::Common 2.005 qw(:Parse);
return ( 'RawInflate' => [1, 1, Parse_boolean, 0] ) ;
}
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm
index 75dcf4ba42..383470a3ee 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Gunzip.pm
@@ -9,12 +9,12 @@ use strict ;
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.004 ;
+use IO::Uncompress::RawInflate 2.005 ;
-use Compress::Raw::Zlib 2.004 qw( crc32 ) ;
-use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
-use IO::Compress::Gzip::Constants 2.004 ;
-use IO::Compress::Zlib::Extra 2.004 ;
+use Compress::Raw::Zlib 2.005 qw( crc32 ) ;
+use IO::Compress::Base::Common 2.005 qw(:Status createSelfTiedObject);
+use IO::Compress::Gzip::Constants 2.005 ;
+use IO::Compress::Zlib::Extra 2.005 ;
require Exporter ;
@@ -28,7 +28,7 @@ Exporter::export_ok_tags('all');
$GunzipError = '';
-$VERSION = '2.004';
+$VERSION = '2.005';
sub new
{
@@ -47,7 +47,7 @@ sub gunzip
sub getExtraParams
{
- use IO::Compress::Base::Common 2.004 qw(:Parse);
+ use IO::Compress::Base::Common 2.005 qw(:Parse);
return ( 'ParseExtra' => [1, 1, Parse_boolean, 0] ) ;
}
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm
index c39170d44b..bd9452bdcd 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Inflate.pm
@@ -5,15 +5,15 @@ use strict ;
use warnings;
use bytes;
-use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
-use IO::Compress::Zlib::Constants 2.004 ;
+use IO::Compress::Base::Common 2.005 qw(:Status createSelfTiedObject);
+use IO::Compress::Zlib::Constants 2.005 ;
-use IO::Uncompress::RawInflate 2.004 ;
+use IO::Uncompress::RawInflate 2.005 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $InflateError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$InflateError = '';
@ISA = qw( Exporter IO::Uncompress::RawInflate );
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm
index a811e656de..a1b438ff5d 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/RawInflate.pm
@@ -5,11 +5,11 @@ use strict ;
use warnings;
use bytes;
-use Compress::Raw::Zlib 2.004 ;
-use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
+use Compress::Raw::Zlib 2.005 ;
+use IO::Compress::Base::Common 2.005 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Base 2.004 ;
-use IO::Uncompress::Adapter::Inflate 2.004 ;
+use IO::Uncompress::Base 2.005 ;
+use IO::Uncompress::Adapter::Inflate 2.005 ;
@@ -17,7 +17,7 @@ use IO::Uncompress::Adapter::Inflate 2.004 ;
require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError);
-$VERSION = '2.004';
+$VERSION = '2.005';
$RawInflateError = '';
@ISA = qw( Exporter IO::Uncompress::Base );
diff --git a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm
index cab4d07538..3721fba64a 100644
--- a/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm
+++ b/ext/IO_Compress_Zlib/lib/IO/Uncompress/Unzip.pm
@@ -8,13 +8,13 @@ use strict ;
use warnings;
use bytes;
-use IO::Uncompress::RawInflate 2.004 ;
-use IO::Compress::Base::Common 2.004 qw(:Status createSelfTiedObject);
-use IO::Uncompress::Adapter::Identity 2.004 ;
-use IO::Compress::Zlib::Extra 2.004 ;
-use IO::Compress::Zip::Constants 2.004 ;
+use IO::Uncompress::RawInflate 2.005 ;
+use IO::Compress::Base::Common 2.005 qw(:Status createSelfTiedObject);
+use IO::Uncompress::Adapter::Identity 2.005 ;
+use IO::Compress::Zlib::Extra 2.005 ;
+use IO::Compress::Zip::Constants 2.005 ;
-use Compress::Raw::Zlib 2.004 qw(crc32) ;
+use Compress::Raw::Zlib 2.005 qw(crc32) ;
BEGIN
{
@@ -27,7 +27,7 @@ require Exporter ;
our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $UnzipError, %headerLookup);
-$VERSION = '2.004';
+$VERSION = '2.005';
$UnzipError = '';
@ISA = qw(Exporter IO::Uncompress::RawInflate);
@@ -60,7 +60,7 @@ sub unzip
sub getExtraParams
{
- use IO::Compress::Base::Common 2.004 qw(:Parse);
+ use IO::Compress::Base::Common 2.005 qw(:Parse);
return (
diff --git a/ext/IO_Compress_Zlib/t/004gziphdr.t b/ext/IO_Compress_Zlib/t/004gziphdr.t
index 4b78b3a5ec..210d499a65 100644
--- a/ext/IO_Compress_Zlib/t/004gziphdr.t
+++ b/ext/IO_Compress_Zlib/t/004gziphdr.t
@@ -189,7 +189,6 @@ for my $value ( "0D", "0A", "0A0D", "0D0A", "0A0A", "0D0D")
ok $hdr->{TextFlag} ;
ok ! defined $hdr->{HeaderCRC} ;
is $hdr->{OsID}, $ThisOS_code ;
-
}
{
@@ -823,6 +822,7 @@ EOM
writeFile($name, $good) ;
ok my $gunz = new IO::Uncompress::Gunzip $name,
+ -Append => 1,
-Strict => 1;
my $uncomp ;
1 while $gunz->read($uncomp) > 0 ;
diff --git a/ext/IO_Compress_Zlib/t/005defhdr.t b/ext/IO_Compress_Zlib/t/005defhdr.t
index 6cdc175a9d..990b79b3f1 100644
--- a/ext/IO_Compress_Zlib/t/005defhdr.t
+++ b/ext/IO_Compress_Zlib/t/005defhdr.t
@@ -42,7 +42,7 @@ sub ReadHeaderInfo
ok $def->close ;
#print "ReadHeaderInfo\n"; hexDump(\$buffer);
- ok my $inf = new IO::Uncompress::Inflate \$buffer ;
+ ok my $inf = new IO::Uncompress::Inflate \$buffer, Append => 1 ;
my $uncomp ;
#ok $inf->read($uncomp) ;
my $actual = 0 ;
@@ -72,7 +72,7 @@ sub ReadHeaderInfoZlib
cmp_ok $def->flush($buffer), '==', Z_OK;
#print "ReadHeaderInfoZlib\n"; hexDump(\$buffer);
- ok my $inf = new IO::Uncompress::Inflate \$buffer ;
+ ok my $inf = new IO::Uncompress::Inflate \$buffer, Append => 1 ;
my $uncomp ;
#ok $inf->read($uncomp) ;
my $actual = 0 ;
diff --git a/ext/IO_Compress_Zlib/t/110encode-deflate.t b/ext/IO_Compress_Zlib/t/110encode-deflate.t
new file mode 100644
index 0000000000..a1f93a9512
--- /dev/null
+++ b/ext/IO_Compress_Zlib/t/110encode-deflate.t
@@ -0,0 +1,21 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = ("../lib", "lib/compress");
+ }
+}
+
+use lib qw(t t/compress);
+use strict;
+use warnings;
+
+use IO::Compress::Deflate qw($DeflateError) ;
+use IO::Uncompress::Inflate qw($InflateError) ;
+
+sub identify
+{
+ 'IO::Compress::Deflate';
+}
+
+require "encode.pl" ;
+run();
diff --git a/ext/IO_Compress_Zlib/t/110encode-gzip.t b/ext/IO_Compress_Zlib/t/110encode-gzip.t
new file mode 100644
index 0000000000..d40c36e905
--- /dev/null
+++ b/ext/IO_Compress_Zlib/t/110encode-gzip.t
@@ -0,0 +1,21 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = ("../lib", "lib/compress");
+ }
+}
+
+use lib qw(t t/compress);
+use strict;
+use warnings;
+
+use IO::Compress::Gzip qw($GzipError) ;
+use IO::Uncompress::Gunzip qw($GunzipError) ;
+
+sub identify
+{
+ 'IO::Compress::Gzip';
+}
+
+require "encode.pl" ;
+run();
diff --git a/ext/IO_Compress_Zlib/t/110encode-rawdeflate.t b/ext/IO_Compress_Zlib/t/110encode-rawdeflate.t
new file mode 100644
index 0000000000..58fa7417b1
--- /dev/null
+++ b/ext/IO_Compress_Zlib/t/110encode-rawdeflate.t
@@ -0,0 +1,21 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = ("../lib", "lib/compress");
+ }
+}
+
+use lib qw(t t/compress);
+use strict;
+use warnings;
+
+use IO::Compress::RawDeflate qw($RawDeflateError) ;
+use IO::Uncompress::RawInflate qw($RawInflateError) ;
+
+sub identify
+{
+ 'IO::Compress::RawDeflate';
+}
+
+require "encode.pl" ;
+run();
diff --git a/ext/IO_Compress_Zlib/t/110encode-zip.t b/ext/IO_Compress_Zlib/t/110encode-zip.t
new file mode 100644
index 0000000000..80e99eec58
--- /dev/null
+++ b/ext/IO_Compress_Zlib/t/110encode-zip.t
@@ -0,0 +1,21 @@
+BEGIN {
+ if ($ENV{PERL_CORE}) {
+ chdir 't' if -d 't';
+ @INC = ("../lib", "lib/compress");
+ }
+}
+
+use lib qw(t t/compress);
+use strict;
+use warnings;
+
+use IO::Compress::Zip qw($ZipError) ;
+use IO::Uncompress::Unzip qw($UnzipError) ;
+
+sub identify
+{
+ 'IO::Compress::Zip';
+}
+
+require "encode.pl" ;
+run();
diff --git a/t/lib/compress/encode.pl b/t/lib/compress/encode.pl
new file mode 100644
index 0000000000..142bd08e59
--- /dev/null
+++ b/t/lib/compress/encode.pl
@@ -0,0 +1,123 @@
+
+use strict;
+use warnings;
+use bytes;
+
+use Test::More ;
+use CompTestUtils;
+
+BEGIN
+{
+ plan skip_all => "Encode is not available"
+ if $] < 5.006 ;
+
+ eval { require Encode; Encode->import(); };
+
+ plan skip_all => "Encode is not available"
+ if $@ ;
+
+ # use Test::NoWarnings, if available
+ my $extra = 0 ;
+
+ my $st = eval { require Test::NoWarnings ; import Test::NoWarnings; 1; };
+ $extra = 1
+ if $st ;
+
+ plan(tests => 7 + $extra) ;
+}
+
+sub run
+{
+ my $CompressClass = identify();
+ my $UncompressClass = getInverse($CompressClass);
+ my $Error = getErrorRef($CompressClass);
+ my $UnError = getErrorRef($UncompressClass);
+
+
+ my $string = "\x{df}\x{100}";
+ my $encString = Encode::encode_utf8($string);
+ my $buffer = $encString;
+
+ #for my $from ( qw(filename filehandle buffer) )
+ {
+# my $input ;
+# my $lex = new LexFile my $name ;
+#
+#
+# if ($from eq 'buffer')
+# { $input = \$buffer }
+# elsif ($from eq 'filename')
+# {
+# $input = $name ;
+# writeFile($name, $buffer);
+# }
+# elsif ($from eq 'filehandle')
+# {
+# $input = new IO::File "<$name" ;
+# }
+
+ for my $to ( qw(filehandle buffer))
+ {
+ title "OO Mode: To $to, Encode by hand";
+
+ my $lex2 = new LexFile my $name2 ;
+ my $output;
+ my $buffer;
+
+ if ($to eq 'buffer')
+ { $output = \$buffer }
+ elsif ($to eq 'filename')
+ {
+ $output = $name2 ;
+ }
+ elsif ($to eq 'filehandle')
+ {
+ $output = new IO::File ">$name2" ;
+ }
+
+
+ my $out ;
+ my $cs = new $CompressClass($output, AutoClose =>1);
+ $cs->print($encString);
+ $cs->close();
+
+ my $input;
+ if ($to eq 'buffer')
+ { $input = \$buffer }
+ else
+ {
+ $input = $name2 ;
+ }
+
+ my $ucs = new $UncompressClass($input, Append => 1);
+ my $got;
+ 1 while $ucs->read($got) > 0 ;
+ my $decode = Encode::decode_utf8($got);
+
+
+ is $string, $decode, " Expected output";
+
+
+ }
+ }
+
+ {
+ title "Catch wide characters";
+
+ my $out;
+ my $cs = new $CompressClass(\$out);
+ my $a = "a\xFF\x{100}";
+ eval { $cs->syswrite($a) };
+ like($@, qr/Wide character in ${CompressClass}::write/,
+ " wide characters in ${CompressClass}::write");
+ eval { syswrite($cs, $a) };
+ like($@, qr/Wide character in ${CompressClass}::write/,
+ " wide characters in ${CompressClass}::write");
+ }
+
+}
+
+
+
+1;
+
diff --git a/t/lib/compress/generic.pl b/t/lib/compress/generic.pl
index 9e808eeb6f..79e62c377a 100644
--- a/t/lib/compress/generic.pl
+++ b/t/lib/compress/generic.pl
@@ -18,7 +18,7 @@ BEGIN
$extra = 1
if $st ;
- plan(tests => 641 + $extra) ;
+ plan(tests => 670 + $extra) ;
}
sub myGZreadFile
@@ -781,7 +781,9 @@ EOT
eval { $io->read(1) } ;
like $@, mkErr("buffer parameter is read-only");
+ $buf = "abcd";
is $io->read($buf, 0), 0, "Requested 0 bytes" ;
+ is $buf, "", "Buffer empty";
is $io->read($buf, 3), 3 ;
is $buf, "Thi";
@@ -791,6 +793,30 @@ EOT
or print "# [$buf]\n" ;;
ok ! $io->eof;
+ $buf = "ab" ;
+ is $io->read($buf, 3, 4), 3 ;
+ is $buf, "ab" . "\x00" x 2 . "s a"
+ or print "# [$buf]\n" ;;
+ ok ! $io->eof;
+
+ # read the rest of the file
+ $buf = '';
+ my $remain = length($str) - 9;
+ is $io->read($buf, $remain+1), $remain ;
+ is $buf, substr($str, 9);
+ ok $io->eof;
+
+ $buf = "hello";
+ is $io->read($buf, 10), 0 ;
+ is $buf, "", "Buffer empty";
+ ok $io->eof;
+
+ ok $io->close();
+ $buf = "hello";
+ is $io->read($buf, 10), 0 ;
+ is $buf, "hello", "Buffer not empty";
+ ok $io->eof;
+
# $io->seek(-4, 2);
#
# ok ! $io->eof;
@@ -930,11 +956,15 @@ EOT
}
- # Test read
+ # Test Read
{
my $io = $UncompressClass->new($name);
+ $buf = "abcd";
+ is $io->read($buf, 0), 0, "Requested 0 bytes" ;
+ is $buf, "", "Buffer empty";
+
ok $io->read($buf, 3) == 3 ;
ok $buf eq "Thi";
@@ -942,6 +972,30 @@ EOT
ok $buf eq "Ths i";
ok ! $io->eof;
+ $buf = "ab" ;
+ is $io->read($buf, 3, 4), 3 ;
+ is $buf, "ab" . "\x00" x 2 . "s a"
+ or print "# [$buf]\n" ;;
+ ok ! $io->eof;
+
+ # read the rest of the file
+ $buf = '';
+ my $remain = length($str) - 9;
+ is $io->read($buf, $remain), $remain ;
+ is $buf, substr($str, 9);
+ ok $io->eof;
+
+ $buf = "hello";
+ is $io->read($buf, 10), 0 ;
+ is $buf, "", "Buffer empty";
+ ok $io->eof;
+
+ ok $io->close();
+ $buf = "hello";
+ is $io->read($buf, 10), 0 ;
+ is $buf, "hello", "Buffer not empty";
+ ok $io->eof;
+
# $io->seek(-4, 2);
#
# ok ! $io->eof;
diff --git a/t/lib/compress/oneshot.pl b/t/lib/compress/oneshot.pl
index 6fdd4c9a71..0646958d89 100644
--- a/t/lib/compress/oneshot.pl
+++ b/t/lib/compress/oneshot.pl
@@ -51,7 +51,7 @@ sub run
like $@, mkErr("^$TopType: unknown key value\\(s\\) Fred"), ' Illegal Parameters';
eval { $a = $Func->() ;} ;
- like $@, mkErr("^$TopType: expected at least 1 parameters"), ' No Parameters';
+ like $@, "/^$TopType: expected at least 1 parameters/", ' No Parameters';
eval { $a = $Func->(\$x, \1) ;} ;
like $$Error, "/^$TopType: output buffer is read-only/", ' Output is read-only' ;
diff --git a/t/lib/compress/tied.pl b/t/lib/compress/tied.pl
index 52f51c7940..7833b9a7d9 100644
--- a/t/lib/compress/tied.pl
+++ b/t/lib/compress/tied.pl
@@ -199,10 +199,10 @@ EOT
{
my $io = new $UncompressClass $name ;
- ok ! $io->eof;
- is $io->tell(), 0 ;
+ ok ! $io->eof, " Not EOF";
+ is $io->tell(), 0, " Tell is 0" ;
my @lines = <$io>;
- is @lines, 6
+ is @lines, 6, " Line is 6"
or print "# Got " . scalar(@lines) . " lines, expected 6\n" ;
is $lines[1], "of a paragraph\n" ;
is join('', @lines), $str ;