From: Paul Marquess Date: Mon, 30 Mar 2009 07:17:04 +0000 (+0100) Subject: Updates for ext/compress* X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dc82791df0cbbf94f0821266b58cedd3897d8ee5;p=p5sagit%2Fp5-mst-13.2.git Updates for ext/compress* --- diff --git a/ext/Compress-Raw-Bzip2/Changes b/ext/Compress-Raw-Bzip2/Changes index f5133db..928bfcd 100644 --- a/ext/Compress-Raw-Bzip2/Changes +++ b/ext/Compress-Raw-Bzip2/Changes @@ -1,10 +1,12 @@ CHANGES ------- - 2.017 26 February 2009 + 2.017 28 March 2009 * Minor changes to allow building in perl core. + * Removed MAN3PODS from Makefile.PL + 2.015 3 September 2008 * Documented bzlibversion diff --git a/ext/Compress-Raw-Bzip2/Makefile.PL b/ext/Compress-Raw-Bzip2/Makefile.PL index 192c28f..ba65694 100644 --- a/ext/Compress-Raw-Bzip2/Makefile.PL +++ b/ext/Compress-Raw-Bzip2/Makefile.PL @@ -35,13 +35,6 @@ WriteMakefile( }, ( - $ENV{SKIP_FOR_CORE} - ? (MAN3PODS => {}) - : () - ), - - - ( $BUILD_BZIP2 ? bzip2_files($BZIP2_LIB) : (LIBS => [ "-L$BZIP2_LIB -lbz2 " ]) @@ -54,6 +47,8 @@ WriteMakefile( : () ), + INSTALLDIRS => ($] > 5.010 ? 'perl' : 'site'), + ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? ('LICENSE' => 'perl') : ()), diff --git a/ext/Compress-Raw-Bzip2/README b/ext/Compress-Raw-Bzip2/README index d54c859..559e5c1 100644 --- a/ext/Compress-Raw-Bzip2/README +++ b/ext/Compress-Raw-Bzip2/README @@ -3,7 +3,7 @@ Version 2.017 - 28th February 2009 + 28th March 2009 Copyright (c) 2005-2009 Paul Marquess. All rights reserved. This program is free software; you can redistribute it diff --git a/ext/Compress-Raw-Bzip2/t/000prereq.t b/ext/Compress-Raw-Bzip2/t/000prereq.t index 1467eed..b8dddca 100644 --- a/ext/Compress-Raw-Bzip2/t/000prereq.t +++ b/ext/Compress-Raw-Bzip2/t/000prereq.t @@ -19,7 +19,7 @@ BEGIN if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - my $VERSION = '2.016'; + my $VERSION = '2.017'; my @NAMES = qw( ); diff --git a/ext/Compress-Raw-Zlib/Changes b/ext/Compress-Raw-Zlib/Changes index 02e68cc..e8e989d 100644 --- a/ext/Compress-Raw-Zlib/Changes +++ b/ext/Compress-Raw-Zlib/Changes @@ -1,10 +1,12 @@ CHANGES ------- - 2.017 1 February 2009 + 2.017 28 March 2009 * Added 'LimitOutput' option + * Removed MAN3PODS from Makefile.PL + * Fixed coring issue when LimitOutput was used. * Documented Compress::Raw::Zlib::zlib_version() diff --git a/ext/Compress-Raw-Zlib/Makefile.PL b/ext/Compress-Raw-Zlib/Makefile.PL index 72a7b89..d141df4 100644 --- a/ext/Compress-Raw-Zlib/Makefile.PL +++ b/ext/Compress-Raw-Zlib/Makefile.PL @@ -77,24 +77,11 @@ WriteMakefile( }, ( - $ENV{SKIP_FOR_CORE} - ? (MAN3PODS => {}) - : () - ), - - ( $BUILD_ZLIB ? zlib_files($ZLIB_LIB) : (LIBS => [ "-L$ZLIB_LIB -lz " ]) ), - ( - $] >= 5.005 - ? (ABSTRACT_FROM => 'lib/Compress/Raw/Zlib.pm', - AUTHOR => 'Paul Marquess ') - : () - ), - INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'), ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? diff --git a/ext/Compress-Raw-Zlib/README b/ext/Compress-Raw-Zlib/README index 1a35da4..99ae85a 100644 --- a/ext/Compress-Raw-Zlib/README +++ b/ext/Compress-Raw-Zlib/README @@ -3,7 +3,7 @@ Version 2.017 - 28th February 2009 + 28th March 2009 Copyright (c) 2005-2009 Paul Marquess. All rights reserved. This program is free software; you can redistribute it diff --git a/ext/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm b/ext/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm index ee87bfa..308a878 100644 --- a/ext/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm +++ b/ext/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm @@ -998,146 +998,13 @@ When C is not specified C<< $i->inflate >> will use as much memory as it takes to write all the uncompressed data it creates by uncompressing the input buffer. -See ?? for a discussion on why C is needed and how to use it. - If C is enabled, the C option will also be enabled. -The input buffer may not have been fully processed, so the C -option will enable C - This option defaults to false. -B - -By default C<< $i->inflate($input, $output) >> will uncompress I data -in C<$input> and write I of the uncompressed data it has generated to -C<$output>. This makes the interface to C much simpler - if the -method has uncompressed C<$input> successfully I compressed data in -C<$input> will have been dealt with. So if you are reading from an input -source and uncompressing as you go the code will look something like this - - use strict ; - use warnings ; - - use Compress::Raw::Zlib; - - my $x = new Compress::Raw::Zlib::Inflate() - or die "Cannot create a inflation stream\n" ; - - my $input = '' ; - - my ($output, $status) ; - while (read(STDIN, $input, 4096)) - { - $status = $x->inflate($input, $output) ; - - print $output ; - - last if $status != Z_OK ; - } - - die "inflation failed\n" - unless $status == Z_STREAM_END ; - -The points to note are - -=over 5 - -=item * - -C will only terminate the loop if it returns a status that isn't -C, i.e. the end of the compressed data stream has been reached or -there has been an error in uncompression. - -=item * - -After the call to C I of the uncompressed data in C<$input> -will have been processed. This means the subsequent call to C can -overwrite it's contents without any problem. - -=back - -For most use-cases the behavior described above is acceptable (this module -and it's predecessor, C, have used it for over 10 years -without an issue), but in a few very specific use-cases the amount of -memory required for C<$output> can prohibitively large. For example, if the -compressed data stream contains the same pattern repeated thousands of -times a relatively small compressed data stream can uncompress into hundreds -of megabytes. Remember C will keep allocating memory until all -the uncompressed data has been written to the output buffer - the size of -C<$output> is unbounded. - -If you need to cope with this use-case, C is for you. - -The main difference in your code when using C is having to -deal with cases where the C<$input> parameter still contains some -uncompressed data that C hasn't processed yet. Below is a typical -code - - use strict ; - use warnings ; - - use Compress::Raw::Zlib; - - my $x = new Compress::Raw::Zlib::Inflate(LimitOutput => 1) - or die "Cannot create a inflation stream\n" ; - - my $input = '' ; - binmode STDIN; - binmode STDOUT; - - my ($output, $status) ; - - OUTER: - while (read(STDIN, $input, 4096)) - { - do - { - $status = $x->inflate($input, $output) ; - - print $output ; - - last OUTER - unless $status == Z_OK || $status == Z_BUF_ERROR ; - } - while ($status == Z_OK && length $input); - } - - die "inflation failed\n" - unless $status == Z_STREAM_END ; - -Points to note this time: - -=over 5 - -=item * - -There are now two nested loops: the outer loop for reading the compressed -data from STDIN; and the inner loop to repeatedly uncompress the C<$input> -buffer. - -=item * - -There are two way the inner loop can be terminated - -=back - -If you know the underlying zlib interface, C will call the -zlib C function once - -Limiting the size of the output buffer means that there will be cases where -C<$input> will not have been completely processed. - -See L for an example of how to use C. - -it will return after a single call to the underlying -zlib C function. - -once the output buffer is full. - -As with the default it will also return if an error is encountered or the -end of the compressed data stream is reached. +See L for a discussion on why C is +needed and how to use it. =back @@ -1288,8 +1155,7 @@ Here is an example of using C. { $status = $x->inflate($input, $output) ; - print $output - if $status == Z_OK or $status == Z_STREAM_END ; + print $output ; last if $status != Z_OK ; } @@ -1365,6 +1231,142 @@ These functions allow checksums to be merged. Returns the version of the zlib library. +=head1 The LimitOutput option. + +By default C<< $i->inflate($input, $output) >> will uncompress I data +in C<$input> and write I of the uncompressed data it has generated to +C<$output>. This makes the interface to C much simpler - if the +method has uncompressed C<$input> successfully I compressed data in +C<$input> will have been dealt with. So if you are reading from an input +source and uncompressing as you go the code will look something like this + + use strict ; + use warnings ; + + use Compress::Raw::Zlib; + + my $x = new Compress::Raw::Zlib::Inflate() + or die "Cannot create a inflation stream\n" ; + + my $input = '' ; + + my ($output, $status) ; + while (read(STDIN, $input, 4096)) + { + $status = $x->inflate($input, $output) ; + + print $output ; + + last if $status != Z_OK ; + } + + die "inflation failed\n" + unless $status == Z_STREAM_END ; + +The points to note are + +=over 5 + +=item * + +The main processing loop in the code handles reading of compressed data +from STDIN. + +=item * + +The status code returned from C will only trigger termination of +the main processing loop if it isn't C. When C has not +been used the C status means means that the end of the compressed +data stream has been reached or there has been an error in uncompression. + +=item * + +After the call to C I of the uncompressed data in C<$input> +will have been processed. This means the subsequent call to C can +overwrite it's contents without any problem. + +=back + +For most use-cases the behavior described above is acceptable (this module +and it's predecessor, C, have used it for over 10 years +without an issue), but in a few very specific use-cases the amount of +memory required for C<$output> can prohibitively large. For example, if the +compressed data stream contains the same pattern repeated thousands of +times, a relatively small compressed data stream can uncompress into +hundreds of megabytes. Remember C will keep allocating memory +until I the uncompressed data has been written to the output buffer - +the size of C<$output> is unbounded. + +The C option is designed to help with this use-case. + +The main difference in your code when using C is having to +deal with cases where the C<$input> parameter still contains some +uncompressed data that C hasn't processed yet. The status code +returned from C will be C if uncompression took place and +C if the output buffer is full. + +Below is typical code that shows how to use C. + + use strict ; + use warnings ; + + use Compress::Raw::Zlib; + + my $x = new Compress::Raw::Zlib::Inflate(LimitOutput => 1) + or die "Cannot create a inflation stream\n" ; + + my $input = '' ; + binmode STDIN; + binmode STDOUT; + + my ($output, $status) ; + + OUTER: + while (read(STDIN, $input, 4096)) + { + do + { + $status = $x->inflate($input, $output) ; + + print $output ; + + last OUTER + unless $status == Z_OK || $status == Z_BUF_ERROR ; + } + while ($status == Z_OK && length $input); + } + + die "inflation failed\n" + unless $status == Z_STREAM_END ; + +Points to note this time: + +=over 5 + +=item * + +There are now two nested loops in the code: the outer loop for reading the +compressed data from STDIN, as before; and the inner loop to carry out the +uncompression. + +=item * + +There are two exit points from the inner uncompression loop. + +Firstly when C has returned a status other than C or +C. This means that either the end of the compressed data +stream has been reached (C) or there is an error in the +compressed data. In either of these cases there is no point in continuing +with reading the compressed data, so both loops are terminated. + +The second exit point tests if there is any data left in the input buffer, +C<$input> - remember that the C option is automatically +enabled when C is used. When the input buffer has been +exhausted, the outer loop can run again and overwrite a now empty +C<$input>. + +=back + =head1 ACCESSING ZIP FILES Although it is possible (with some effort on your part) to use this diff --git a/ext/IO-Compress/Changes b/ext/IO-Compress/Changes index f422d5b..8faec2a 100644 --- a/ext/IO-Compress/Changes +++ b/ext/IO-Compress/Changes @@ -3,14 +3,18 @@ CHANGES 2.017 30 March 2009 - * TODO - mention LimitOutput - - * A few chenges to get the test harness to work on VMS courtesy of - Craig. A. Berry. - * Merged IO-Compress-Base, IO-Compress-Bzip2, IO-Compress-Zlib & Compress-Zlib into IO-Compress. + * The interface to Compress-Raw-Zlib now uses the new LimitOutput + feature. This will make all of the zlib-related IO-Compress modules + less greedy in their memory consumption. + + * Removed MAN3PODS from Makefile.PL + + * A few changes to get the test harness to work on VMS courtesy of + Craig. A. Berry. + * IO::Compress::Base & IO::Uncompress::Base Downgraded some croaks in the constructors to just set $! (by letting the code attempt to open a file and fail). @@ -27,6 +31,10 @@ CHANGES 0xFFFFFFFF. Also the ZIP64 extra field was 4 bytes short. Problem spotted by Dino Chiesa. + * IO::Uncompress::Unzip + - use POSIX::mktime instead of Time::Local::timelocal to convert + the zip DOS time field into Unix time. + * Compress::Zlib - Documented Compress::Zlib::zlib_version() diff --git a/ext/IO-Compress/Makefile.PL b/ext/IO-Compress/Makefile.PL index b939d59..e11cf8f 100644 --- a/ext/IO-Compress/Makefile.PL +++ b/ext/IO-Compress/Makefile.PL @@ -22,7 +22,7 @@ WriteMakefile( ( $ENV{SKIP_FOR_CORE} - ? (MAN3PODS => {}) + ? () : (PREREQ_PM => { 'Compress::Raw::Bzip2' => $::VERSION, 'Compress::Raw::Zlib' => $::VERSION, $] >= 5.005 && $] < 5.006 @@ -38,6 +38,14 @@ WriteMakefile( : () ), + INSTALLDIRS => ($] >= 5.009 ? 'perl' : 'site'), + + ( + $] >= 5.009 && ! $ENV{PERL_CORE} + ? (INST_LIB => 'blib/arch') + : () + ), + ((ExtUtils::MakeMaker->VERSION() gt '6.30') ? ('LICENSE' => 'perl') : ()), diff --git a/ext/IO-Compress/README b/ext/IO-Compress/README index 07ae661..6f283b3 100644 --- a/ext/IO-Compress/README +++ b/ext/IO-Compress/README @@ -3,7 +3,7 @@ Version 2.017 - 28th February 2009 + 28th March 2009 Copyright (c) 1995-2009 Paul Marquess. All rights reserved. This program is free software; you can redistribute it @@ -13,9 +13,18 @@ DESCRIPTION ----------- This distribution provides a Perl interface to allow reading and writing of -compressed data created with the zlib and bziip2 libraries. +compressed data created with the zlib and bzip2 libraries. -The distribiution also ocontain the Compress::Zlib modeule. +IO-Compress supports reading and writing of bzip2, RFC 1950, RFC +1951, RFC 1952 (i.e. gzip) and zip files/buffers. + +The following modules used to be distributed separately, but are now +included with the IO-Compress distribution. + + Compress-Zlib + IO-Compress-Zlib + IO-Compress-Bzip2 + IO-Compress-Base PREREQUISITES ------------- diff --git a/ext/IO-Compress/examples/io/bzip2/bzcat b/ext/IO-Compress/examples/io/bzip2/bzcat index 7d74643..8112320 100755 --- a/ext/IO-Compress/examples/io/bzip2/bzcat +++ b/ext/IO-Compress/examples/io/bzip2/bzcat @@ -2,7 +2,7 @@ use IO::Uncompress::Bunzip2 qw( $Bunzip2Error ); use strict ; -local ($^W) = 1; #use warnings ; +use warnings ; #die "Usage: gzcat file...\n" # unless @ARGV ; diff --git a/ext/IO-Compress/examples/io/bzip2/bzgrep b/ext/IO-Compress/examples/io/bzip2/bzgrep index 1ac162c..ceb4e84 100755 --- a/ext/IO-Compress/examples/io/bzip2/bzgrep +++ b/ext/IO-Compress/examples/io/bzip2/bzgrep @@ -1,7 +1,7 @@ #!/usr/bin/perl use strict ; -local ($^W) = 1; #use warnings ; +use warnings ; use IO::Uncompress::Bunzip2 qw($Bunzip2Error); die "Usage: gzgrep pattern [file...]\n" diff --git a/ext/IO-Compress/examples/io/bzip2/bzstream b/ext/IO-Compress/examples/io/bzip2/bzstream index 9bba3a5..3e88d68 100755 --- a/ext/IO-Compress/examples/io/bzip2/bzstream +++ b/ext/IO-Compress/examples/io/bzip2/bzstream @@ -1,7 +1,7 @@ #!/usr/local/bin/perl use strict ; -local ($^W) = 1; #use warnings ; +use warnings ; use IO::Compress::Bzip2 qw(:all); bzip2 '-' => '-' diff --git a/ext/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm b/ext/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm index 7e6b019..ca650c6 100644 --- a/ext/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm +++ b/ext/IO-Compress/lib/IO/Compress/Adapter/Bzip2.pm @@ -4,13 +4,13 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.016 qw(:Status); +use IO::Compress::Base::Common 2.017 qw(:Status); #use Compress::Bzip2 ; -use Compress::Raw::Bzip2 2.016 ; +use Compress::Raw::Bzip2 2.017 ; our ($VERSION); -$VERSION = '2.016'; +$VERSION = '2.017'; sub mkCompObject { diff --git a/ext/IO-Compress/lib/IO/Compress/Bzip2.pm b/ext/IO-Compress/lib/IO/Compress/Bzip2.pm index 356ba1a..144b978 100644 --- a/ext/IO-Compress/lib/IO/Compress/Bzip2.pm +++ b/ext/IO-Compress/lib/IO/Compress/Bzip2.pm @@ -5,16 +5,16 @@ use warnings; use bytes; require Exporter ; -use IO::Compress::Base 2.016 ; +use IO::Compress::Base 2.017 ; -use IO::Compress::Base::Common 2.016 qw(createSelfTiedObject); -use IO::Compress::Adapter::Bzip2 2.016 ; +use IO::Compress::Base::Common 2.017 qw(createSelfTiedObject); +use IO::Compress::Adapter::Bzip2 2.017 ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bzip2Error); -$VERSION = '2.016'; +$VERSION = '2.017'; $Bzip2Error = ''; @ISA = qw(Exporter IO::Compress::Base); @@ -51,7 +51,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.016 qw(:Parse); + use IO::Compress::Base::Common 2.017 qw(:Parse); return ( 'BlockSize100K' => [0, 1, Parse_unsigned, 1], diff --git a/ext/IO-Compress/lib/IO/Compress/Zip.pm b/ext/IO-Compress/lib/IO/Compress/Zip.pm index 73b158a..35a968f 100644 --- a/ext/IO-Compress/lib/IO/Compress/Zip.pm +++ b/ext/IO-Compress/lib/IO/Compress/Zip.pm @@ -21,9 +21,9 @@ BEGIN import IO::Compress::Bzip2 2.017 ; } ; # eval { require IO::Compress::Adapter::Lzma ; -# import IO::Compress::Adapter::Lzma 2.016 ; +# import IO::Compress::Adapter::Lzma 2.017 ; # require IO::Compress::Lzma ; -# import IO::Compress::Lzma 2.016 ; +# import IO::Compress::Lzma 2.017 ; # } ; } diff --git a/ext/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm b/ext/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm index 680dbfc..802afce 100644 --- a/ext/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm +++ b/ext/IO-Compress/lib/IO/Uncompress/Adapter/Bunzip2.pm @@ -4,13 +4,13 @@ use strict; use warnings; use bytes; -use IO::Compress::Base::Common 2.016 qw(:Status); +use IO::Compress::Base::Common 2.017 qw(:Status); #use Compress::Bzip2 ; -use Compress::Raw::Bzip2 2.016 ; +use Compress::Raw::Bzip2 2.017 ; our ($VERSION, @ISA); -$VERSION = '2.016'; +$VERSION = '2.017'; #@ISA = qw( Compress::Raw::Bunzip2 ); diff --git a/ext/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm b/ext/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm index e7b36c8..088fd9d 100644 --- a/ext/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm +++ b/ext/IO-Compress/lib/IO/Uncompress/AnyUncompress.pm @@ -31,7 +31,7 @@ BEGIN eval ' use IO::Uncompress::Adapter::Bunzip2 2.017 ;'; eval ' use IO::Uncompress::Adapter::LZO 2.017 ;'; eval ' use IO::Uncompress::Adapter::Lzf 2.017 ;'; - #eval ' use IO::Uncompress::Adapter::UnLzma 2.016 ;'; + #eval ' use IO::Uncompress::Adapter::UnLzma 2.017 ;'; eval ' use IO::Uncompress::Bunzip2 2.017 ;'; eval ' use IO::Uncompress::UnLzop 2.017 ;'; @@ -40,7 +40,7 @@ BEGIN eval ' use IO::Uncompress::RawInflate 2.017 ;'; eval ' use IO::Uncompress::Unzip 2.017 ;'; eval ' use IO::Uncompress::UnLzf 2.017 ;'; - #eval ' use IO::Uncompress::UnLzma 2.016 ;'; + #eval ' use IO::Uncompress::UnLzma 2.017 ;'; } sub new diff --git a/ext/IO-Compress/lib/IO/Uncompress/Bunzip2.pm b/ext/IO-Compress/lib/IO/Uncompress/Bunzip2.pm index 5fb1879..0162ad6 100644 --- a/ext/IO-Compress/lib/IO/Uncompress/Bunzip2.pm +++ b/ext/IO-Compress/lib/IO/Uncompress/Bunzip2.pm @@ -4,15 +4,15 @@ use strict ; use warnings; use bytes; -use IO::Compress::Base::Common 2.016 qw(:Status createSelfTiedObject); +use IO::Compress::Base::Common 2.017 qw(:Status createSelfTiedObject); -use IO::Uncompress::Base 2.016 ; -use IO::Uncompress::Adapter::Bunzip2 2.016 ; +use IO::Uncompress::Base 2.017 ; +use IO::Uncompress::Adapter::Bunzip2 2.017 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $Bunzip2Error); -$VERSION = '2.016'; +$VERSION = '2.017'; $Bunzip2Error = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @@ -40,7 +40,7 @@ sub getExtraParams { my $self = shift ; - use IO::Compress::Base::Common 2.016 qw(:Parse); + use IO::Compress::Base::Common 2.017 qw(:Parse); return ( 'Verbosity' => [1, 1, Parse_boolean, 0], diff --git a/ext/IO-Compress/lib/IO/Uncompress/Unzip.pm b/ext/IO-Compress/lib/IO/Uncompress/Unzip.pm index 08f94db..45ef3b5 100644 --- a/ext/IO-Compress/lib/IO/Uncompress/Unzip.pm +++ b/ext/IO-Compress/lib/IO/Uncompress/Unzip.pm @@ -702,12 +702,9 @@ sub filterUncompressed } -# from Archive::Zip +# from Archive::Zip & info-zip sub _dosToUnixTime { - #use Time::Local 'timelocal_nocheck'; - use Time::Local 'timelocal'; - my $dt = shift; my $year = ( ( $dt >> 25 ) & 0x7f ) + 80; @@ -718,11 +715,11 @@ sub _dosToUnixTime my $min = ( ( $dt >> 5 ) & 0x3f ); my $sec = ( ( $dt << 1 ) & 0x3e ); - # catch errors - my $time_t = - eval { timelocal( $sec, $min, $hour, $mday, $mon, $year ); }; - return 0 - if $@; + + use POSIX 'mktime'; + + my $time_t = mktime( $sec, $min, $hour, $mday, $mon, $year, 0, 0, -1 ); + return 0 if ! defined $time_t; return $time_t; } diff --git a/ext/IO-Compress/t/000prereq.t b/ext/IO-Compress/t/000prereq.t index 3ac318f..c56e7bd 100644 --- a/ext/IO-Compress/t/000prereq.t +++ b/ext/IO-Compress/t/000prereq.t @@ -19,7 +19,7 @@ BEGIN if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - my $VERSION = '2.016'; + my $VERSION = '2.017'; my @NAMES = qw( Compress::Raw::Bzip2 Compress::Raw::Zlib