From: Ilkka Ollakka Date: Mon, 12 Oct 2009 13:39:19 +0000 (+0300) Subject: playlist.c: change FindPrefix to include access on returned string X-Git-Tag: 1.1.0-ff~2910 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c041421df47283ce6d32cbabafaaa9558da66583;p=vlc playlist.c: change FindPrefix to include access on returned string --- diff --git a/modules/demux/playlist/playlist.c b/modules/demux/playlist/playlist.c index 6799451a7c..7721a07258 100644 --- a/modules/demux/playlist/playlist.c +++ b/modules/demux/playlist/playlist.c @@ -182,7 +182,17 @@ char *FindPrefix( demux_t *p_demux ) { char *psz_file; char *psz_prefix; - const char *psz_path = p_demux->psz_path; + char *psz_path; + if( p_demux->psz_access ) + { + if( asprintf( &psz_path,"%s://%s", p_demux->psz_access, p_demux->psz_path ) == -1 ) + return NULL; + } + else + { + if( asprintf( &psz_path,"%s", p_demux->psz_path ) == -1 ) + return NULL; + } #ifdef WIN32 psz_file = strrchr( psz_path, '\\' ); @@ -194,6 +204,7 @@ char *FindPrefix( demux_t *p_demux ) psz_prefix = strndup( psz_path, psz_file - psz_path + 1 ); else psz_prefix = strdup( "" ); + free( psz_path ); return psz_prefix; }