[vlc-commits] ftp: fix readdir in default directory

Thomas Guillem git at videolan.org
Mon May 4 09:53:44 CEST 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sun May  3 16:36:31 2015 +0000| [6ecd2a42548e6be7a1bcad20abc24fbc08a7d041] | committer: Thomas Guillem

ftp: fix readdir in default directory

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6ecd2a42548e6be7a1bcad20abc24fbc08a7d041
---

 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 273e5fc..7d3f19d 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -842,11 +842,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;
 



More information about the vlc-commits mailing list