[evolution/webkit: 134/154] Use case-insensitive lookup of mime-type handler (fixes #668655)



commit bfcb8ea0a9581418ee218937b0158c2cf7c863ac
Author: Dan VrÃtil <dvratil redhat com>
Date:   Thu Jan 26 14:01:41 2012 +0100

    Use case-insensitive lookup of mime-type handler (fixes #668655)

 em-format/em-format.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 6a46efd..7efa352 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -1808,17 +1808,25 @@ em_format_class_remove_handler (EMFormatClass *emfc,
 
 const EMFormatHandler *
 em_format_find_handler (EMFormat *emf,
-						const gchar *mime_type)
+                        const gchar *mime_type)
 {
 	EMFormatClass *emfc;
+        gchar *s;
+        const EMFormatHandler *handler;
 
 	g_return_val_if_fail (EM_IS_FORMAT (emf), NULL);
 	g_return_val_if_fail (mime_type && *mime_type, NULL);
 
 	emfc = (EMFormatClass *) G_OBJECT_GET_CLASS (emf);
 
-	return g_hash_table_lookup (
-			emfc->type_handlers, mime_type);
+        s = g_ascii_strdown (mime_type, -1);
+
+        handler = g_hash_table_lookup (
+			emfc->type_handlers, s);
+
+        g_free (s);
+
+        return handler;
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]