[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug in file command magic

Giovanni Funchal wrote:

I've just noticed that the file command returns wrong mime for a file.
In fact, if a LaTeX file uses the command \bibligraphystyle somewhere
in the beginning, file will return mime "text/vnd.graphviz" instead of
"text/x-tex". I took a look at /usr/share/file/magic (on Lenny), and
it has something like :

0    regex/100    [\r\n\t\ ]*graph[\r\n\t\ ]*.*\\{    graphviz graph text
!:mime    text/vnd.graphviz

This regular expression matches \biblioGRAPHystyle in the first
thousand characters or so. A good fix would be :

- 0    regex/100    [\r\n\t\ ]*graph[\r\n\t\ ]*.*\\{    graphviz graph text
+ 0    regex/100    (^|[\r\n\t\ ]+)graph[\r\n\t\ ]*.*\\{    graphviz graph text

Since in the dot file format[1], the keyword "graph" must be preceded
by a white space or be in the beginning of the file.

Anyone knows where I can report this?

-- Giovanni

[1] http://www.graphviz.org/doc/info/lang.html

I think this belongs to package 'file'...

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply to: