[gvfs/gnome-2-26] Bug 534027 – Nautilus does not handle symlinks on an ftp server



commit 9548fabcd45973a9e624c10744bca45e8c7051f6
Author: Andreas Henriksson <andreas fatal se>
Date:   Wed Jun 3 18:08:37 2009 +0200

    Bug 534027 â?? Nautilus does not handle symlinks on an ftp server
    
    Previously, the ftp symlink resolving code failed to properly account
    for absolute symlinks and treated all symlinks as relative.
---
 daemon/gvfsbackendftp.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/daemon/gvfsbackendftp.c b/daemon/gvfsbackendftp.c
index 949573d..89e3dc0 100644
--- a/daemon/gvfsbackendftp.c
+++ b/daemon/gvfsbackendftp.c
@@ -1210,10 +1210,18 @@ dir_default_iter_process (gpointer        iter,
 
       if (symlink)
 	{
-	  char *str = g_path_get_dirname (s);
-	  char *symlink_file = g_build_path ("/", str, link, NULL);
+          char *str;
+          char *symlink_file;
+
+          if (link[0] != '/')
+            {
+              str = g_path_get_dirname (s);
+              symlink_file = g_build_path ("/", str, link, NULL);
+              g_free (str);
+            }
+          else
+            symlink_file = g_strdup(link);
 
-	  g_free (str);
 	  while ((str = strstr (symlink_file, "/../")))
 	    {
 	      char *end = str + 4;



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