]> git.sesse.net Git - vlc/commitdiff
Treat directory items like file ones for URI->name generation
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 12 Jul 2009 13:48:51 +0000 (16:48 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 12 Jul 2009 13:48:51 +0000 (16:48 +0300)
src/input/item.c

index b37a8b7fee9662e47805ad254f0c826032feab29..ac6006dfa6d69692e082a7bc95107122039e30ed 100644 (file)
@@ -363,7 +363,10 @@ void input_item_SetURI( input_item_t *p_i, const char *psz_uri )
 
     p_i->i_type = GuessType( p_i );
 
-    if( !p_i->psz_name && p_i->i_type == ITEM_TYPE_FILE )
+    if( p_i->psz_name )
+        ;
+    else
+    if( p_i->i_type == ITEM_TYPE_FILE || p_i->i_type == ITEM_TYPE_DIRECTORY )
     {
         const char *psz_filename = strrchr( p_i->psz_uri, '/' );
 
@@ -376,12 +379,11 @@ void input_item_SetURI( input_item_t *p_i, const char *psz_uri )
         if( p_i->psz_name )
             decode_URI( p_i->psz_name );
     }
-
-    /* The name is NULL: fill it with everything except login and password */
-    if( !p_i->psz_name )
-    {
+    else
+    {   /* Strip login and password from title */
         int r;
         vlc_url_t url;
+
         vlc_UrlParse( &url, psz_uri, 0 );
         if( url.psz_protocol )
         {