]> git.sesse.net Git - vlc/commitdiff
Fixed a regression with --sub-autodetect-path
authorLaurent Aimar <fenrir@videolan.org>
Sat, 29 Sep 2007 16:02:15 +0000 (16:02 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sat, 29 Sep 2007 16:02:15 +0000 (16:02 +0000)
Ignore directories in --sub-autodetect-path that match the directory
of the current file (But it does not works with symbolic links).

src/input/subtitles.c

index 82fa84383192966d7585a0af5eacdc3b80fb068f..ed1c26790352c90b577177128ab3d3f7b253188a 100644 (file)
@@ -207,7 +207,7 @@ static char **paths_to_list( const char *psz_dir, char *psz_path )
     if( !subdirs )
         return NULL;
 
-    for( i = 0; *psz_parser != '\0' ; )
+    for( i = 0; psz_parser && *psz_parser != '\0' ; )
     {
         char *psz_subdir = psz_parser;
         psz_parser = strchr( psz_subdir, ',' );
@@ -323,7 +323,7 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
         int i_dir_content;
         int a;
 
-        if( psz_dir == NULL )
+        if( psz_dir == NULL || ( j >= 0 && !strcmp( psz_dir, f_dir ) ) )
             continue;
 
         /* parse psz_src dir */