Subject: | Hexadecimal offset that use capital letters (A-F) do not parse. |
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 =~ /^\(/) {