Shared-mime checking order

David Faure dfaure at trolltech.com
Fri Feb 1 08:48:02 PST 2008


> David Faure wrote:
> > However I just had a case where "take subclass" might be needed:
> > when the *magic* conflicts. Try "<!--foo--><html>bar</html>": this should
> > be detected as text/html, but it's detected as application/xml here because
> > both mimetypes have       <match value="&lt;!--" type="string" offset="0"/>
> > and they have the same priority for that magic rule! (50)
> > I believe this is a bug in freedesktop.org.xml, the rules for html should have higher
> > priority than the rules for xml, to fix this. But I guess we could also say
> > "the xml is fine, we just need to pick the subclass when conflicting magic rules
> > match". I wouldn't like that though, since it would make the implementation
> > more complex.
> > 
> > Do you agree with making the magic rules for xml priority 40?
> 
On Tuesday 16 October 2007, Alexander Larsson wrote:
> Yes, that sounds good to me.

OK, can someone make the change in CVS -- or can I get a CVS account?
We still have the above bug... Please apply this patch:

--- freedesktop.org.xml.in      31 Jan 2008 14:24:08 -0000      1.295
+++ freedesktop.org.xml.in      1 Feb 2008 16:46:28 -0000
@@ -4012,7 +4012,7 @@ command to generate the output files.
     <_comment>XML document</_comment>
     <acronym>XML</acronym>
     <expanded-acronym>eXtensible Markup Language</expanded-acronym>
-    <magic priority="50">
+    <magic priority="40">
       <match type="string" value="&lt;?xml" offset="0"/>
       <match type="string" value="&lt;!--" offset="0"/>
     </magic>

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the xdg mailing list