Bug 266 - application/x-mozilla-bookmarks not detected
Summary: application/x-mozilla-bookmarks not detected
Status: RESOLVED FIXED
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: freedesktop.org.xml (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-03 14:45 UTC by Marco Pesenti Gritti
Modified: 2007-10-19 13:33 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Marco Pesenti Gritti 2004-03-03 14:45:56 UTC
To reproduce run test-mime on a mozilla bookmarks file. It will be detected as
text/html.
I guess it's because glob has priority over magic and mozilla bookmarks file has
extension .html. If you change the extension it works correctly.

The same probably apply to x-netscape-bookmarks.
Comment 1 Jonathan Blandford 2004-03-21 20:14:36 UTC
I upped the magic here.
Comment 2 Marco Pesenti Gritti 2004-03-22 01:59:54 UTC
It doesnt seem to work yet.

bash-2.05b$ ./test-mime /home/mpeseng/bookmarks.html
File "/home/mpeseng/bookmarks.html" has a mime-type of text/html

As I said this seem to happen because glob matching has priority over magics.
application/x-xbel doesnt have any glob matching, though even adding *.html it
doesnt work correctly. In fact we dont seem to have a way to deal with glob
matching of multiple types, we just use the first match.
Maybe we should fall back to magics if there are multiple glob matches ?
Comment 3 Bastien Nocera 2005-11-01 03:16:41 UTC
This is a problem in the different implementations, not in shared-mime-info
itself. As Marco said, glob has precedence over magic right now.
Comment 4 Matthias Clasen 2006-07-20 07:29:10 UTC
The xdgmime implementation behaviour in the presence of  multiple matches
has been improved some time ago. Is this still a problem ?
Comment 5 Christian - Manny Calavera - Neumair 2007-06-01 08:28:12 UTC
Thanks for your bug report. This wasn't an xdgmime bug, but a shared-mime-info bug. I merged the mozilla and netscape bookmark MIME type definitions, and added glob patterns for this MIME type. It seems to fix the problem for me.
Comment 6 D Bera 2007-10-19 05:06:53 UTC
(In reply to comment #5)
> Thanks for your bug report. This wasn't an xdgmime bug, but a shared-mime-info
> bug. I merged the mozilla and netscape bookmark MIME type definitions, and
> added glob patterns for this MIME type. It seems to fix the problem for me.

But why was the extension match added for this MIME-type ? Now xdg_mime_get_mime_type_from_file_name reports _every_ *.html file as a mozilla-bookmark file. 
https://bugs.freedesktop.org/show_bug.cgi?id=11843
Probably because as said earlier, glob has precedence over magic!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.