Skip to content

Commit 64a106f

Browse files
committed
Use Time::Local instead of POSIX::mktime
1 parent efa2319 commit 64a106f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

META.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"Compress::Raw::Bzip2" : "2.103",
3838
"Compress::Raw::Zlib" : "2.103",
3939
"Scalar::Util" : "0",
40-
"Encode" : "0"
40+
"Encode" : "0",
41+
"Time::Local" : "0"
4142
}
4243
}
4344
},

META.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ requires:
2424
Compress::Raw::Zlib: '2.103'
2525
Scalar::Util: '0'
2626
Encode: '0'
27+
Time::Local: '0'
2728
resources:
2829
bugtracker: https://github.com/pmqs/IO-Compress/issues
2930
homepage: https://github.com/pmqs/IO-Compress

Makefile.PL

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ WriteMakefile(
2929
'Compress::Raw::Zlib' => $::DEP_VERSION,
3030
'Scalar::Util' => 0,
3131
'Encode' => 0,
32+
'Time::Local' => 0,
3233
$] >= 5.005 && $] < 5.006
3334
? ('File::BSDGlob' => 0)
3435
: () }

lib/IO/Uncompress/Unzip.pm

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,12 +812,10 @@ sub _dosToUnixTime
812812
my $min = ( ( $dt >> 5 ) & 0x3f );
813813
my $sec = ( ( $dt << 1 ) & 0x3e );
814814

815-
816-
use POSIX 'mktime';
817-
818-
my $time_t = mktime( $sec, $min, $hour, $mday, $mon, $year, 0, 0, -1 );
815+
use Time::Local ;
816+
my $time_t = Time::Local::timegm( $sec, $min, $hour, $mday, $mon, $year);
819817
return 0 if ! defined $time_t;
820-
return $time_t;
818+
return $time_t;
821819
}
822820

823821
#sub scanCentralDirectory

0 commit comments

Comments
 (0)