Commit b7091051 authored by Benjamin Pracht's avatar Benjamin Pracht

Handle correctly some more error cases

parent 5ec39eb4
...@@ -93,7 +93,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -93,7 +93,6 @@ static int Open( vlc_object_t *p_this )
GnomeVFSURI *p_uri = NULL; GnomeVFSURI *p_uri = NULL;
GnomeVFSResult i_ret; GnomeVFSResult i_ret;
GnomeVFSHandle *p_handle = NULL; GnomeVFSHandle *p_handle = NULL;
if( !(gnome_vfs_init()) ) if( !(gnome_vfs_init()) )
{ {
msg_Warn( p_access, "couldn't initilize GnomeVFS" ); msg_Warn( p_access, "couldn't initilize GnomeVFS" );
...@@ -159,12 +158,14 @@ static int Open( vlc_object_t *p_this ) ...@@ -159,12 +158,14 @@ static int Open( vlc_object_t *p_this )
char *psz_path_begin; char *psz_path_begin;
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,"/" )
&& 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 = strstr( psz_unescaped, url.psz_path );
*psz_path_begin = '\0'; if( psz_path_begin ) *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 );
...@@ -176,6 +177,11 @@ static int Open( vlc_object_t *p_this ) ...@@ -176,6 +177,11 @@ static int Open( vlc_object_t *p_this )
{ {
psz_uri = psz_unescaped; psz_uri = psz_unescaped;
} }
}
else
{
psz_uri = psz_unescaped;
}
g_free( psz_expand_tilde ); g_free( psz_expand_tilde );
p_uri = gnome_vfs_uri_new( psz_uri ); p_uri = gnome_vfs_uri_new( psz_uri );
......
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