diff lib/misc.c @ 555:7f54d0c0edbc

2004-9-17 Brian Masney <masneyb@gftp.org> * lib/misc.c lib/cache.c lib/config_file.c lib/gftp.h lib/protocols.c lib/rfc2068.c lib/sshv2.c src/gtk/bookmarks.c src/gtk/dnd.c src/gtk/gftp-gtk.c src/gtk/gtkui.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/transfer.c src/uicommon/gftpui.c - added gftp_request argument to gftp_build_path() and expand_path(). Renamed expand_path() to gftp_expand_path() * lib/gftp.h - fixed compile error in gftp_need_username macro
author masneyb
date Fri, 17 Sep 2004 23:37:47 +0000
parents 34a3f10d8bae
children fa0838b22b14
line wrap: on
line diff
--- a/lib/misc.c	Tue Sep 14 10:24:01 2004 +0000
+++ b/lib/misc.c	Fri Sep 17 23:37:47 2004 +0000
@@ -135,7 +135,7 @@
 
 
 char *
-expand_path (const char *src)
+gftp_expand_path (gftp_request * request, const char *src)
 {
   char *str, *pos, *endpos, *prevpos, *newstr, *tempstr, *ntoken,
        tempchar;
@@ -228,7 +228,7 @@
       if ((pos = strchr (newstr, '/')) == NULL)
 	str = g_strdup (pw->pw_dir);
       else
-	str = gftp_build_path (pw->pw_dir, pos, NULL);
+	str = gftp_build_path (request, pw->pw_dir, pos, NULL);
 
       g_free (newstr);
       newstr = str;
@@ -1127,7 +1127,7 @@
 
 
 char *
-gftp_build_path (const char *first_element, ...) 
+gftp_build_path (gftp_request * request, const char *first_element, ...) 
 {
   const char *element;
   size_t len, retlen;
@@ -1161,7 +1161,9 @@
       retlen += len;
       ret = g_realloc (ret, retlen + 1);
 
-      if (add_separator)
+      /* Don't append a / for VMS servers... */
+      if (add_separator &&
+          (request == NULL || request->server_type != GFTP_DIRTYPE_VMS))
         strncat (ret, "/", retlen);
 
       strncat (ret, element, retlen);