changeset 3946:081a8ee0c0ae

branch merge
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Fri, 16 Nov 2007 02:50:52 +0900
parents 0b93c2b0cd59 (diff) dae0d3a9f8f1 (current diff)
children eb20411bb9e1
files
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Thu Nov 15 17:57:29 2007 +0100
+++ b/src/audacious/playlist.c	Fri Nov 16 02:50:52 2007 +0900
@@ -3471,9 +3471,10 @@
 static gboolean
 filter_by_extension(const gchar *uri)
 {
-    gchar *base, *ext, *filename;
+    gchar *base, *ext, *lext, *filename;
     gchar *tmp = g_filename_from_uri(uri, NULL, NULL);
-    
+    gboolean rv;
+
     filename = g_strdup(tmp ? tmp : uri);
     g_free(tmp);
     
@@ -3486,17 +3487,23 @@
 #if 0
         if(g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { //allow a file without extension.
             g_print("no ext file\n");
-            return TRUE;
+            rv = TRUE;
         }
         else
-            return FALSE;
+            rv = FALSE;
 #else
-        return FALSE; //disallow.
+        rv = FALSE; //disallow.
 #endif
+        return rv;
     }
 
-    if(g_hash_table_lookup(ext_hash, ext+1))
-        return TRUE;
+    lext = g_ascii_strdown(ext+1, -1);
+
+    if(g_hash_table_lookup(ext_hash, lext))
+        rv = TRUE;
     else
-        return FALSE;
+        rv = FALSE;
+
+    g_free(lext);
+    return rv;
 }