diff src/gtk/menu-items.c @ 211:3f2203e70218

2003-7-6 Brian Masney <masneyb@gftp.org> * lib/protocols.c lib/sshv2.c src/gtk/dnd.c src/gtk/menu-items.c - instead of using g_strconcat to build the directory paths, use g_build_path. Fixes a bug when you was connected to a remote host, and you was in /, the path would show up as // (from Krzysztof Foltman <kfoltman@onet.pl>, slightly changed by me)
author masneyb
date Sun, 06 Jul 2003 14:14:34 +0000
parents 3fa7b4f4ab78
children de6a2e8e51cb
line wrap: on
line diff
--- a/src/gtk/menu-items.c	Sun Jul 06 13:52:43 2003 +0000
+++ b/src/gtk/menu-items.c	Sun Jul 06 14:14:34 2003 +0000
@@ -533,10 +533,15 @@
   templist = get_next_selection (templist, &filelist, &num);
   tempfle = filelist->data;
 
-  newdir = g_strconcat (wdata->request->directory, "/", tempfle->file, NULL);
-  remove_double_slashes (newdir);
+  newdir = g_build_path (G_DIR_SEPARATOR_S, wdata->request->directory, 
+                         tempfle->file, NULL);
+
   if ((tempstr = expand_path (newdir)) == NULL)
-    return (0);
+    {
+      g_free (newdir);
+      return (0);
+    }
+
   g_free (newdir);
 
   if (check_reconnect (wdata) < 0)
@@ -999,4 +1004,3 @@
       curlist = curlist->next;
     }
 }
-