]> git.sesse.net Git - vlc/commitdiff
* Cleaner url parsing
authorBenjamin Pracht <bigben@videolan.org>
Fri, 30 Sep 2005 17:18:45 +0000 (17:18 +0000)
committerBenjamin Pracht <bigben@videolan.org>
Fri, 30 Sep 2005 17:18:45 +0000 (17:18 +0000)
modules/access/gnomevfs.c

index d551d8a9100ebeeb9a0573032429dc87ec1e13f3..9fa55a271890bd2ef5682d1fe5b3c7f9488587e4 100644 (file)
@@ -160,12 +160,12 @@ static int Open( vlc_object_t *p_this )
         vlc_UrlParse( &url, psz_unescaped, 0 );
         psz_escaped_path = gnome_vfs_escape_path_string( url.psz_path );
 
-        if( psz_escaped_path && strcmp( psz_escaped_path,"/" )
-                                        && strcmp( psz_escaped_path,"//" ) )
+        if( psz_escaped_path )
         {
     /* Now let's reconstruct a valid URI from all that stuff */
-            psz_path_begin = strstr( psz_unescaped, url.psz_path );
-            if( psz_path_begin ) *psz_path_begin = '\0';
+            psz_path_begin = psz_unescaped + strlen( psz_unescaped )
+                                           - strlen( url.psz_path );
+            *psz_path_begin = '\0';
             psz_uri = malloc( strlen( psz_unescaped ) +
                                         strlen( psz_escaped_path ) + 1 );
             sprintf( psz_uri, "%s%s",psz_unescaped, psz_escaped_path );