]> git.sesse.net Git - vlc/blobdiff - modules/access/ftp.c
* skins2/controls/ctrl_image.cpp: fixed a resizing bug.
[vlc] / modules / access / ftp.c
index ab605811fc63f521b75beff9e5f7dc50ea919d7f..ccc10ce0cbff24c2ed41e0a5f67d8bcf1cd883df 100644 (file)
@@ -238,6 +238,12 @@ static int Open( vlc_object_t *p_this )
         p_sys->url.i_port = 21; /* default port */
     }
 
+    /* FTP URLs are relative to user's default directory (RFC1738)
+       For absolute path use ftp://foo.bar//usr/local/etc/filename */
+
+    if( *p_sys->url.psz_path == '/' )
+        p_sys->url.psz_path++;
+
     if( Connect( p_access, p_sys ) < 0 )
         goto exit_error;
 
@@ -250,8 +256,7 @@ static int Open( vlc_object_t *p_this )
 
     if( ftp_ReadCommand( p_access, &i_answer, NULL ) == 2 )
     {
-        if( net_GetPeerAddress( p_access, p_sys->fd_cmd, p_sys->sz_epsv_ip,
-                                NULL ) )
+        if( net_GetPeerAddress( p_sys->fd_cmd, p_sys->sz_epsv_ip, NULL ) )
             goto exit_error;
     }
     else