Modify ↓
#1568 closed enhancement (fixed)
Case sensitive mime types
| Reported by: | PBruin | Owned by: | Jonas Borgström |
|---|---|---|---|
| Priority: | low | Milestone: | 0.9 |
| Component: | version control/browser | Version: | devel |
| Severity: | normal | Keywords: | browser, case sensitive, mimeview |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
My company still uses a lot of legacy code that has filenames like FILE1.C and FILE1.H. This means that the mimeview api does not recognize them as c files. Can you include the following patch in the trunk so the mimeview api becomes case insensitive?
Index: api.py
===================================================================
--- api.py (revision 1682)
+++ api.py (working copy)
@@ -92,6 +92,7 @@
try:
i = filename.rfind('.')
suffix = filename[i+1:]
+ suffix = suffix.lower()
return MIME_MAP[suffix]
except KeyError:
import mimetypes
Thanks.
Attachments (0)
Note:
See TracTickets
for help on using tickets.



Actually, as mrowe informed me, the uppercase ".C" and ".H" are actually considered to be C++ extensions, not C (see http://www.saugus.net/Computer/Extensions/).
In [1684] I added these extensions to the mime-map as C++ mappings, but the parsing for C++ should also work on C code, so your files should be highlighted properly.