Skip to content

Commit ad987ab

Browse files
authoredFeb 15, 2020
Merge pull request #10 from fabiensanglard/master
Fix wrong START offset
2 parents dbd3160 + f3a0a47 commit ad987ab

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎bin/zipdetails

+5-3
Original file line numberDiff line numberDiff line change
@@ -1590,9 +1590,6 @@ sub scanCentralDirectory
15901590
my $comment_length = unpack("v", substr($buffer, 32, 2));
15911591
my $locHeaderOffset = unpack("V", substr($buffer, 42, 4));
15921592

1593-
$START = $locHeaderOffset
1594-
if ! defined $START;
1595-
15961593
skip($fh, $filename_length ) ;
15971594

15981595
if ($extra_length)
@@ -1655,6 +1652,11 @@ sub scanCentralDirectory
16551652

16561653
# @CD = sort { $a->[0]->cmp($b->[0]) } @CD ;
16571654
@CD = sort { $a->[0] <=> $b->[0] } @CD ;
1655+
1656+
# Set the first LFH offset.
1657+
$START = $CD[0]->[0]
1658+
if $#CD > 0;
1659+
16581660
return (1, @CD);
16591661
}
16601662

0 commit comments

Comments
 (0)