[gvfs/ftp-reorg] [FTP] do not add double slashes when constructing relative to root



commit b870deb75f162091e222d49e42cf6f0340e87320
Author: Benjamin Otte <otte gnome org>
Date:   Thu Jun 4 18:40:53 2009 +0200

    [FTP] do not add double slashes when constructing relative to root
---
 daemon/gvfsftpfile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/gvfsftpfile.c b/daemon/gvfsftpfile.c
index 7f0b45e..f72c0fa 100644
--- a/daemon/gvfsftpfile.c
+++ b/daemon/gvfsftpfile.c
@@ -171,7 +171,7 @@ g_vfs_ftp_file_new_child (const GVfsFtpFile *parent, const char *display_name, G
       return NULL;
     }
 
-  new_path = g_strconcat (parent->gvfs_path, "/", display_name, NULL);
+  new_path = g_strconcat (parent->gvfs_path, parent->gvfs_path[1] == 0 ? "" : "/", display_name, NULL);
   child = g_vfs_ftp_file_new_from_gvfs (parent->backend, new_path);
   g_free (new_path);
   return child;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]