From fc479b2a46849ffe42eb17a3162a38e27900fe93 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 8 Oct 1999 22:00:52 +0000 Subject: no_comment --- perl-install/common.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'perl-install/common.pm') 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; } -- cgit v1.2.1