changeset 247:f41650dc896c

2003-8-6 Brian Masney <masneyb@gftp.org> * lib/misc.c (gftp_build_path) - fixed initial path beginning with //. (expand_path) - when the path is empty at the end, set it to /. This would happen for directories like /etc/..
author masneyb
date Wed, 06 Aug 2003 20:31:34 +0000
parents 290d00853950
children 16a967a4d003
files ChangeLog lib/misc.c
diffstat 2 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 05 01:54:03 2003 +0000
+++ b/ChangeLog	Wed Aug 06 20:31:34 2003 +0000
@@ -1,3 +1,8 @@
+2003-8-6 Brian Masney <masneyb@gftp.org>
+	* lib/misc.c (gftp_build_path) - fixed initial path beginning with //.
+	(expand_path) - when the path is empty at the end, set it to /. This
+	would happen for directories like /etc/..
+
 2003-8-4 Brian Masney <masneyb@gftp.org>
 	* src/gtk/transfer.c (update_file_status) - fix possible division by 0
 
@@ -1433,7 +1438,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.127 2003/08/05 01:54:02 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.128 2003/08/06 20:31:30 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/lib/misc.c	Tue Aug 05 01:54:03 2003 +0000
+++ b/lib/misc.c	Wed Aug 06 20:31:34 2003 +0000
@@ -195,7 +195,7 @@
       if (newstr != NULL)
 	g_free (newstr);
 
-      newstr = g_malloc0 (1);
+      newstr = g_strdup ("/");
     }
 
   g_free (str);
@@ -205,7 +205,7 @@
       if ((pos = strchr (newstr, '/')) == NULL)
 	str = g_strdup (pw->pw_dir);
       else
-	str = g_strconcat (pw->pw_dir, pos, NULL);
+	str = gftp_build_path (pw->pw_dir, pos, NULL);
 
       g_free (newstr);
       newstr = str;
@@ -1203,11 +1203,11 @@
 
   g_return_val_if_fail (first_element != NULL, NULL);
 
-  ret = g_malloc0 (1);
-  retlen = 0;
+  ret = g_strdup (first_element);
+  retlen = strlen (ret);
 
   va_start (args, first_element);
-  for (element = first_element;
+  for (element = va_arg (args, char *);
        element != NULL;
        element = va_arg (args, char *))
     {