summaryrefslogtreecommitdiffstats
path: root/libhb/bd.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-02-22 05:21:04 +0000
committerjstebbins <[email protected]>2014-02-22 05:21:04 +0000
commit993d19bcffe30ae1213ebe040083a86b2c33300f (patch)
tree95a574db516d36610edb1fcbfd160d4e18351150 /libhb/bd.c
parentab50e34327aea45ed0a1b258d07bd269dcc39a9e (diff)
libhb: clean up handling dir directory separator
title->name was getting set to an empty string in some cases due to looking for the wrong directory separator. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6057 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/bd.c')
-rw-r--r--libhb/bd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libhb/bd.c b/libhb/bd.c
index 9cd9d6ef1..586a1fa7b 100644
--- a/libhb/bd.c
+++ b/libhb/bd.c
@@ -253,11 +253,14 @@ hb_title_t * hb_bd_title_scan( hb_bd_t * d, int tt, uint64_t min_duration )
char * p_cur, * p_last = d->path;
for( p_cur = d->path; *p_cur; p_cur++ )
{
- if( p_cur[0] == '/' && p_cur[1] )
+ if( IS_DIR_SEP(p_cur[0]) && p_cur[1] )
{
p_last = &p_cur[1];
}
}
+ char *dot_term = strrchr(p_last, '.');
+ if (dot_term)
+ *dot_term = '\0';
snprintf( title->name, sizeof( title->name ), "%s", p_last );
strncpy( title->path, d->path, 1024 );
title->path[1023] = 0;