diff options
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index f2d458a26..9dc3e3c6a 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -359,11 +359,15 @@ sub typeFromMagic($@) { local *F; sysopen F, $f, 0 or return; my $tmp; - foreach (@_) { - my ($name, $offset, $signature) = @$_; - sysseek(F, $offset, 0) or next; - sysread(F, $tmp, length $signature); - $tmp eq $signature and return $name; + M: foreach (@_) { + my ($name, @l) = @$_; + while (@l) { + my ($offset, $signature) = splice(@l, 0, 2); + sysseek(F, $offset, 0) or next M; + sysread(F, $tmp, length $signature); + $tmp eq $signature or next M; + } + return $name; } undef; } |