]> git.sesse.net Git - vlc/commitdiff
folder: use make_path
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 20 Feb 2010 18:57:48 +0000 (20:57 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 20 Feb 2010 18:57:48 +0000 (20:57 +0200)
modules/meta_engine/folder.c

index 9c30d3ecf89c380548a28694bb310f964a34e0a4..3fb65ca8ad5f4ae52b2c02884c7eec6455d90608 100644 (file)
@@ -90,20 +90,12 @@ static int FindMeta( vlc_object_t *p_this )
     if( !psz_dir )
         return VLC_EGENERIC;
 
-    char *psz_path = psz_dir;
-    if( strncmp( psz_path, "file://", 7 ) || !decode_URI( psz_path + 7 ) )
-    {
-        free( psz_dir );
+    char *psz_path = make_path( psz_dir );
+    free( psz_dir );
+    if( psz_path == NULL )
         return VLC_EGENERIC;
-    }
 
-#if defined(WIN32) && !defined(UNDER_CE)
-    psz_path += 8;
-#else
-    psz_path += 7;
-#endif
-
-    char *psz_buf = strrchr( psz_path, '/' );
+    char *psz_buf = strrchr( psz_path, DIR_SEP_CHAR );
     if( psz_buf )
         *++psz_buf = '\0';
     else
@@ -134,7 +126,5 @@ static int FindMeta( vlc_object_t *p_this )
         }
     }
 
-    free( psz_dir );
-
     return b_have_art ? VLC_SUCCESS : VLC_EGENERIC;
 }