Bug 732

Summary: Mime system doesn't handle file types in upper case
Product: xdgmime Reporter: Kjartan Maraas <kmaraas>
Component: xdgmimeAssignee: Jonathan Blandford <jrb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: archana.shah, vinay.mandyakoppal
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: fix the "ignore case" case.
possible fix

Description Kjartan Maraas 2004-06-08 01:00:00 UTC
Downloaded some docs from a server and they had .DOC and .XLS file names which
the GNOME mime handlers didn't recognize. We should treat upper and lower case
the same when it comes to file types I guess. There's a lot of cameras that save
stuff with all upper case filenames too, and that makes it a royal PITA to
manage the pictures after downloading them to the computer.
Comment 1 Christophe Fergeau 2004-07-30 11:17:06 UTC
Reassigning to xdgmime, it's probably more appropriate there.
Comment 2 Christophe Fergeau 2004-11-26 04:09:52 UTC
*** Bug 1908 has been marked as a duplicate of this bug. ***
Comment 3 Christophe Fergeau 2004-11-26 05:01:35 UTC
This is a bug in xdgmime code. It is supposed to fallback to a case unsensitive
match when it couldn't find an exact match, but it doesn't work.
The problem is in _xdg_glob_hash_node_lookup_file_name. When doing a case
unsensitive lookup, it assumes "_xdg_ucs4_to_upper (character)" will be greater
than "character", which is not the case in ASCII, so the loop trying to match
characters stops after processing upper case chars in the magic pattern, but
before processing any lower case chars.
The attached patch should fix that.
Comment 4 Christophe Fergeau 2004-11-26 05:02:42 UTC
Created attachment 1383 [details] [review]
fix the "ignore case" case.
Comment 5 Marco Pesenti Gritti 2004-12-09 06:28:07 UTC
Created attachment 1500 [details] [review]
possible fix

I was thinking to something like this. The idea is to follow the spec when it
says to first do a case sensitive comparation and then convert the filename to
lower case.
Comment 6 Marco Pesenti Gritti 2004-12-09 06:42:45 UTC
checked in
Comment 7 Marco Pesenti Gritti 2004-12-09 14:44:40 UTC
*** Bug 888 has been marked as a duplicate of this bug. ***

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.