From: Yoann Peronneau Date: Fri, 9 Jun 2006 00:28:07 +0000 (+0000) Subject: * fix subtitles file autodetection X-Git-Tag: 0.9.0-test0~11037 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9b21a3e02405a59a10b0649feccad9e8295b74a2;p=vlc * fix subtitles file autodetection this was broken when the video file name included its directory name (for instance "vlc dir/file.avi") --- diff --git a/src/input/subtitles.c b/src/input/subtitles.c index 5d65eb1727..19bc365386 100644 --- a/src/input/subtitles.c +++ b/src/input/subtitles.c @@ -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 );