talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit de0d6d263e40307d18966c4fc46460f6bfbef5be
parent ec06e2ebb838748dbeb6f40c95482e86e7f62b6e
Author: Colin Leroy <colin@colino.net>
Date:   Sun, 29 Sep 2013 11:02:56 +0200

Fix bug #3004, "claws picks wrong mime type for attachments"
Use first match for each extension

Diffstat:
Msrc/procmime.c | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/procmime.c b/src/procmime.c @@ -1150,12 +1150,11 @@ static GHashTable *procmime_get_mime_type_table(void) exts = g_strsplit(mime_type->extension, " ", 16); for (i = 0; exts[i] != NULL; i++) { - /* use previously dup'd key on overwriting */ - if (g_hash_table_lookup(table, exts[i])) - key = exts[i]; - else + /* Don't overwrite previously inserted extension */ + if (!g_hash_table_lookup(table, exts[i])) { key = g_strdup(exts[i]); - g_hash_table_insert(table, key, mime_type); + g_hash_table_insert(table, key, mime_type); + } } g_strfreev(exts); }