Commit e4e839be authored by Benjamin Pracht's avatar Benjamin Pracht

* Cleaner url parsing

parent 76807978
...@@ -160,12 +160,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -160,12 +160,12 @@ static int Open( vlc_object_t *p_this )
vlc_UrlParse( &url, psz_unescaped, 0 ); vlc_UrlParse( &url, psz_unescaped, 0 );
psz_escaped_path = gnome_vfs_escape_path_string( url.psz_path ); psz_escaped_path = gnome_vfs_escape_path_string( url.psz_path );
if( psz_escaped_path && strcmp( psz_escaped_path,"/" ) if( psz_escaped_path )
&& strcmp( psz_escaped_path,"//" ) )
{ {
/* Now let's reconstruct a valid URI from all that stuff */ /* Now let's reconstruct a valid URI from all that stuff */
psz_path_begin = strstr( psz_unescaped, url.psz_path ); psz_path_begin = psz_unescaped + strlen( psz_unescaped )
if( psz_path_begin ) *psz_path_begin = '\0'; - strlen( url.psz_path );
*psz_path_begin = '\0';
psz_uri = malloc( strlen( psz_unescaped ) + psz_uri = malloc( strlen( psz_unescaped ) +
strlen( psz_escaped_path ) + 1 ); strlen( psz_escaped_path ) + 1 );
sprintf( psz_uri, "%s%s",psz_unescaped, psz_escaped_path ); sprintf( psz_uri, "%s%s",psz_unescaped, psz_escaped_path );
......
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