mbeijen / File-MimeInfo

Perl module for determining file types using the freedesktop.org shared mime-info database
https://metacpan.org/module/File::MimeInfo
20 stars 14 forks source link

mimetype always reports text/plain when reading from stdin #27

Open ghost opened 7 years ago

ghost commented 7 years ago

It seems that without rinning ::rehash() first,

$File::MimeInfo::Magiv::max_buffer is not defined and that results in readling 0 Bytes from stdin in the following line:

read(STDIN, $data, $File::MimeInfo::Magic::max_buffer);

The patch is tracked in the Debian GIt repository at

https://anonscm.debian.org/cgit/pkg-perl/packages/libfile-mimeinfo-perl.git/plain/debian/patches/fix_read_from_stdin.patch

Thanks for considering. Simon Kainz, Debian Perl Group