summaryrefslogtreecommitdiff
path: root/xdg
diff options
context:
space:
mode:
authorThomas Kluyver <takowl@gmail.com>2013-03-05 13:40:53 +0000
committerThomas Kluyver <takowl@gmail.com>2013-03-05 13:40:53 +0000
commitf87e662ed27edf88152dd6980120b2cf64890db9 (patch)
tree142cb9a6d2b86767ba2603c627ba9ee9cd9fe14f /xdg
parent489089762051cb95fbd8cdc84a94f8954af256f8 (diff)
Prefer first glob for finding mimetype, not last
Diffstat (limited to 'xdg')
-rw-r--r--xdg/Mime.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/xdg/Mime.py b/xdg/Mime.py
index b20159e..c25ea1e 100644
--- a/xdg/Mime.py
+++ b/xdg/Mime.py
@@ -360,7 +360,8 @@ def _cache_database():
if pattern.startswith('*.'):
rest = pattern[2:]
if not ('*' in rest or '[' in rest or '?' in rest):
- exts[rest] = mtype
+ if rest not in exts:
+ exts[rest] = mtype
continue
if '*' in pattern or '[' in pattern or '?' in pattern:
globs.append((pattern, mtype))