changeset 3947:eb20411bb9e1

fixed bug in extension filtering function
author mf0102 <0102@gmx.at>
date Thu, 15 Nov 2007 21:25:25 +0100
parents 081a8ee0c0ae
children 57ff64831bec
files src/audacious/playlist.c
diffstat 1 files changed, 6 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Fri Nov 16 02:50:52 2007 +0900
+++ b/src/audacious/playlist.c	Thu Nov 15 21:25:25 2007 +0100
@@ -3477,27 +3477,16 @@
 
     filename = g_strdup(tmp ? tmp : uri);
     g_free(tmp);
-    
+
     base = g_path_get_basename(filename);
-    ext = strrchr(base, '.');
-
-    g_free(base);
+    ext = g_strrstr(base, ".");
 
     if(!ext) {
-#if 0
-        if(g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { //allow a file without extension.
-            g_print("no ext file\n");
-            rv = TRUE;
-        }
-        else
-            rv = FALSE;
-#else
-        rv = FALSE; //disallow.
-#endif
-        return rv;
+        g_free(base);
+        return FALSE;
     }
 
-    lext = g_ascii_strdown(ext+1, -1);
+    lext = g_utf8_strdown(ext+1, -1);
 
     if(g_hash_table_lookup(ext_hash, lext))
         rv = TRUE;
@@ -3505,5 +3494,6 @@
         rv = FALSE;
 
     g_free(lext);
+    g_free(base);
     return rv;
 }