? attachment.cgi?id=31607 ? diff ? dot.diff ? leak.diff ? xdg.diff ? xdgmime-case-sentivity.diff ? src/attachment.cgi?id=31610 ? src/eps.eps ? src/t ? src/test.gnumeric ? src/test.p1 ? src/test.tp1 ? src/xdg.diff Index: ChangeLog =================================================================== RCS file: /cvs/mime/xdgmime/ChangeLog,v retrieving revision 1.41 diff -p -u -i -r1.41 ChangeLog --- ChangeLog 16 Apr 2005 20:49:31 -0000 1.41 +++ ChangeLog 16 Apr 2005 23:07:10 -0000 @@ -1,3 +1,11 @@ +2005-04-17 Christophe Fergeau + + * src/xdgmimemagic.c: (_xdg_mime_magic_matchlet_compare_to_data), + (_xdg_mime_magic_matchlet_compare_level), + (_xdg_mime_magic_lookup_data): when magic patterns matches, check if + there aren't subtypes with matching patterns too, and if so, favour + the subtype over the parent type, should fix #2686 + 2005-04-16 Christophe Fergeau * src/xdgmime.c: (xdg_mime_init_from_directory): fix leak when Index: src/xdgmimemagic.c =================================================================== RCS file: /cvs/mime/xdgmime/src/xdgmimemagic.c,v retrieving revision 1.15 diff -p -u -i -r1.15 xdgmimemagic.c --- src/xdgmimemagic.c 16 Apr 2005 20:05:50 -0000 1.15 +++ src/xdgmimemagic.c 16 Apr 2005 23:07:10 -0000 @@ -268,7 +268,7 @@ _xdg_mime_magic_parse_header (FILE *magi if (c != ':') return XDG_MIME_MAGIC_ERROR; - buffer = _xdg_mime_magic_read_to_newline (magic_file, &end_of_file); + buffer = (char *)_xdg_mime_magic_read_to_newline (magic_file, &end_of_file); if (end_of_file) return XDG_MIME_MAGIC_EOF; @@ -656,16 +656,20 @@ _xdg_mime_magic_lookup_data (XdgMimeMagi size_t len) { XdgMimeMagicMatch *match; + const char *mime_type; + mime_type = NULL; for (match = mime_magic->match_list; match; match = match->next) { if (_xdg_mime_magic_match_compare_to_data (match, data, len)) { - return match->mime_type; + if ((mime_type == NULL) || (xdg_mime_mime_type_subclass (match->mime_type, mime_type))) { + mime_type = match->mime_type; + } } } - return NULL; + return mime_type; } static void