[vlc-devel] [PATCH 3/3] ftp: fix readdir in root folder

Thomas Guillem thomas at gllm.fr
Sun May 3 19:36:31 CEST 2015


---
 modules/access/ftp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index e16a0c4..2ea9862 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -848,11 +848,13 @@ static int DirRead (access_t *p_access, input_item_node_t *p_current_node)
     {
         char *psz_uri;
 
-        if( asprintf( &psz_uri, "%s://%s:%d/%s/%s",
+        if( asprintf( &psz_uri, "%s://%s:%d%s%s/%s",
                       ( p_sys->tlsmode == NONE ) ? "ftp" :
                       ( ( p_sys->tlsmode == IMPLICIT ) ? "ftps" : "ftpes" ),
                       p_sys->url.psz_host, p_sys->url.i_port,
-                      p_sys->url.psz_path, psz_line ) != -1 )
+                      p_sys->url.psz_path ? "/" : "",
+                      p_sys->url.psz_path ? p_sys->url.psz_path : "",
+                      psz_line ) != -1 )
         {
             input_item_t *p_item;
 
-- 
2.1.4




More information about the vlc-devel mailing list