]> git.sesse.net Git - vlc/commitdiff
* fix subtitles file autodetection
authorYoann Peronneau <yoann@videolan.org>
Fri, 9 Jun 2006 00:28:07 +0000 (00:28 +0000)
committerYoann Peronneau <yoann@videolan.org>
Fri, 9 Jun 2006 00:28:07 +0000 (00:28 +0000)
  this was broken when the video file name included its directory name
  (for instance "vlc dir/file.avi")

src/input/subtitles.c

index 5d65eb1727cee38832f4b33f4cc5cf2ddb080e32..19bc365386ad5c4172f44a2a758091c5dc8eb488 100644 (file)
@@ -292,8 +292,8 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
 
         f_fname = malloc( strlen(tmp) );
         if( f_fname )
-            strcpy( f_fname, tmp+1 ); // we skip the seperator, so it will still fit in the allocated space
-        dirlen = strlen(psz_fname) - strlen(tmp) + 1; // add the seperator
+            strcpy( f_fname, tmp+1 ); // we skip the separator, so it will still fit in the allocated space
+        dirlen = strlen(psz_fname) - strlen(tmp) + 2; // add the separator
         f_dir = malloc( dirlen + 1 );
         if( f_dir != NULL )
             strlcpy( f_dir, psz_fname, dirlen );