[vlc-commits] subtitles: Fix subtitles detection.

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 10 16:09:51 CEST 2012


vlc/vlc-2.0 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Apr 10 15:26:39 2012 +0200| [b7f6772ecd882719de32053f8c0d38a351e90b61] | committer: Jean-Baptiste Kempf

subtitles: Fix subtitles detection.
(cherry picked from commit 5395e9b85e5823b41cf7353b327445c6ff426edf)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 src/input/subtitles.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/input/subtitles.c b/src/input/subtitles.c
index b7505b6..f7222c1 100644
--- a/src/input/subtitles.c
+++ b/src/input/subtitles.c
@@ -273,14 +273,15 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
         return NULL;
     }
 
-    char *f_fname = strrchr( f_dir, DIR_SEP_CHAR );
+    const char *f_fname = strrchr( psz_fname, DIR_SEP_CHAR );
     if( !f_fname )
     {
         free( f_dir );
         free( psz_fname );
         return NULL;
     }
-    *(++f_fname) = 0; /* keep dir separator in f_dir */
+    f_fname++; /* Skip the '/' */
+    f_dir[f_fname - psz_fname] = 0; /* keep dir separator in f_dir */
 
     i_fname_len = strlen( f_fname );
 



More information about the vlc-commits mailing list