diff src/gtk/gtkui_transfer.c @ 631:056c54ac52a0

2004-12-2 Brian Masney <masneyb@gftp.org> * src/gtk/gtkui_transfer.c (gftpui_ask_transfer) - fixes for the first character of the filename being stripped off when it already existed on the remote side and it was being uploaded to the root directory. Note, the file truncation only occured in it being displayed to the user. It was not stripping the filename when it was being transfered (from Aurelien Jarno <aurelien@aurel32.net >) (fixes #158713)
author masneyb
date Thu, 02 Dec 2004 22:33:05 +0000
parents 5df46f79d9c1
children afbe37351940
line wrap: on
line diff
--- a/src/gtk/gtkui_transfer.c	Thu Dec 02 22:22:31 2004 +0000
+++ b/src/gtk/gtkui_transfer.c	Thu Dec 02 22:33:05 2004 +0000
@@ -286,10 +286,12 @@
         }
       tempfle->shown = 1;
 
+      len = strlen (tdata->toreq->directory);
       pos = tempfle->destfile;
-      len = strlen (tdata->toreq->directory);
+      if (len == 1 && (*tdata->toreq->directory) == '/')
+        pos++;
       if (strncmp (pos, tdata->toreq->directory, len) == 0)
-        pos = tempfle->destfile + len + 1;
+        pos += len + 1;
 
       utf8_file = gftp_string_to_utf8 (tdata->toreq, pos);
       add_data[0] = utf8_file != NULL ? utf8_file : pos;