Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 28620
Status: resolved
Priority: 0/
Queue: File-MimeInfo

People
Owner: Nobody in particular
Requestors: jflack [...] math.purdue.edu
Cc:
AdminCc:

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



Subject: File::MimeInfo::Magic and masked values
Date: Wed, 01 Aug 2007 17:25:02 -0400
To: bug-File-MimeInfo [...] rt.cpan.org
From: Chapman Flack <jflack [...] math.purdue.edu>
When a match rule has a mask, the module currently uses the mask to mask off the input read from the file, but compares it to the original (not masked off) value from the match rule, which probably isn't going to match. You can see the problem by creating a file with first line 12345678CRDXvrsn and confirming that it *fails* to match the rule for application/vnd.corel-draw. (You could confirm the problem using other matches that have masks, too.) Fix: suggest adding just before the line 'my $end = $o + $l + $r;' the following: $v &= ( my $wtf = $m ) if defined $m; (I got tired of trying to determine why the simple $v &= $m if defined $m; didn't work, at least in perl 5.8.8 on Solaris; it causes a 'Modification of a read-only' error at a different line, later in the run, I'm guessing a perl bug, and can't chase *everything* down. The line above works.) Chapman Flack mathematics Purdue
Subject: Re: [rt.cpan.org #28620] File::MimeInfo::Magic and masked values
Date: Thu, 02 Aug 2007 10:24:00 -0400
To: bug-File-MimeInfo [...] rt.cpan.org
From: Chapman Flack <jflack [...] math.purdue.edu>
I first wrote: Show quoted text
> You can see the problem by creating a file with first line > > 12345678CRDXvrsn > > and confirming that it *fails* to match the rule for > application/vnd.corel-draw. (You could confirm the problem
Woops - of *course* that will fail. The real point is, even if spelled right, 12345678CDRXvrsn ^^ it still fails (and works, after the masking is fixed). Chapman Flack mathematics Purdue
Fixed in 0.15. After working on RT #28635 this test succeeds now.