Skip Menu |
 

This queue is for tickets about the File-MMagic CPAN distribution.

Report information
The Basics
Id: 14619
Status: open
Priority: 0/
Queue: File-MMagic

People
Owner: Nobody in particular
Requestors: dtikhonov [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.25
Fixed in: (no value)



Subject: Hexadecimal offset that use capital letters (A-F) do not parse.
Download (untitled) / with headers
text/plain 952b
I have discovered a small bug in File::MMagic -- when lines are read from magic file, hexadecimal offsets that use capital letters are not matched. For instance, my magic file contains the following line: 0x1FE leshort 0xAA55 x86 boot sector Originally, this produced this error: Bad Offset/Type at line 1988. '0x1FE leshort 0xAA55 x86 boot sector ' This will do the trick: --- MMagic.pm 15 Sep 2005 19:22:56 -0000 1.1.1.1 +++ MMagic.pm 15 Sep 2005 20:43:20 -0000 1.2 @@ -1159,7 +1159,7 @@ # or hex offset or an indirect offset specified in parenthesis # like (x[.[bsl]][+-][y]), or a relative offset specified by &. # offtype : 0 = absolute, 1 = indirect, 2 = relative - if ($line =~ s/^>*([&\(]?[a-flsx\.\+\-\d]+\)?)\s+(\S+)\s+//) { + if ($line =~ s/^>*([&\(]?[a-flsx\.\+\-\d]+\)?)\s+(\S+)\s+//i) { ($offset,$type) = ($1,$2); if ($offset =~ /^\(/) {
RT-Send-CC: knok [...] daionet.gr.jp
Download (untitled) / with headers
text/plain 652b
Sorry for my late reply. I considered to change the following patch. It will be included in the next release. Thank you for your report. diff --git a/MMagic.pm b/MMagic.pm --- a/MMagic.pm +++ b/MMagic.pm @@ -1159,7 +1159,7 @@ sub readMagicLine { # or hex offset or an indirect offset specified in parenthesis # like (x[.[bsl]][+-][y]), or a relative offset specified by &. # offtype : 0 = absolute, 1 = indirect, 2 = relative - if ($line =~ s/^>*([&\(]?[a-flsx\.\+\-\d]+\)?)\s+(\S+)\s+//) { + if ($line =~ s/^>*([&\(]?[a-fA-Flsx\.\+\-\d]+\)?)\s+(\S+)\s+//) { ($offset,$type) = ($1,$2); if ($offset =~ /^\(/) {


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.