Subject: | Double-close on a filehandle |
Date: | Fri, 21 Feb 2014 11:30:57 +0100 |
To: | bug-File-MimeInfo [...] rt.cpan.org |
From: | Christian Ludwig <chrissicool [...] googlemail.com> |
I ran into the following error:
Can't use an undefined value as a symbol reference at /usr/share/perl5/File/MimeInfo/Magic.pm line 46.
The problem is that _magic() closes the fd when it finds a result for
lower priority rules. mimetype() then tries to close it again.
Since we take a completely different route in mimetype() if 'ref file'
is true, we can close the fd safely whenever the low-priority rules
return one.
The appended patch fixes the issue.
Message body is not shown because sender requested not to inline it.