[vlc-devel] commit: folder: use make_path ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Feb 20 19:58:43 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb 20 20:57:48 2010 +0200| [d459aab3dd59d8264cb15656bacb3e3de5f2dffa] | committer: Rémi Denis-Courmont 

folder: use make_path

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d459aab3dd59d8264cb15656bacb3e3de5f2dffa
---

 modules/meta_engine/folder.c |   18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/modules/meta_engine/folder.c b/modules/meta_engine/folder.c
index 9c30d3e..3fb65ca 100644
--- a/modules/meta_engine/folder.c
+++ b/modules/meta_engine/folder.c
@@ -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;
 }




More information about the vlc-devel mailing list