Commit d0031ad2 authored by Francois Cartegnie's avatar Francois Cartegnie

lua_http: fix name parsing on encoded uri

parent 06108030
......@@ -500,6 +500,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
if( lua_isstring( L, -1 ) )
{
const char *psz_path = NULL;
char *psz_u8path = NULL;
const char *psz_name = NULL;
char **ppsz_options = NULL;
int i_options = 0;
......@@ -520,7 +521,15 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
{
if( !lua_isnil( L, -1 ) )
msg_Warn( p_this, "Playlist item name should be a string." );
psz_name = psz_path;
psz_u8path = make_path( psz_path );
if ( psz_u8path )
{
psz_name = strrchr( psz_u8path, '/' );
if ( psz_name != NULL )
psz_name++;
}
if ( !psz_name ) psz_name = psz_path;
}
/* Read duration */
......@@ -574,6 +583,7 @@ int vlclua_playlist_add_internal( vlc_object_t *p_this, lua_State *L,
while( i_options > 0 )
free( ppsz_options[--i_options] );
free( ppsz_options );
free( psz_u8path );
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment