--- /dev/null
+--- busybox-1.00/networking/ftpgetput.c.orig 2005-02-15 13:30:36.000000000 +0100
++++ busybox-1.00/networking/ftpgetput.c 2005-02-15 14:00:35.315575696 +0100
+@@ -227,15 +227,51 @@
+ int fd_local;
+ int response;
+
++ int server_sl = -1;
++ int local_sl = -1;
++ char local_fname[512];
++ char server_fname[512];
++ char server_fpath[1024];
++ char *temp;
++ int i;
++
++ strcpy (server_fpath, server_path);
++
++ for (i = 0; server_fpath[i] != '\0'; i++)
++ if (server_fpath[i] == '/') server_sl = i;
++
++ if (server_sl == -1) {
++ strcpy(server_fname, server_fpath);
++ server_fpath[0] = '\0';
++ } else {
++ temp = server_fpath + server_sl;
++ strcpy(server_fname, temp);
++ server_fpath[server_sl+1] = '\0';
++ }
++
++ for (i = 0; local_path[i] != '\0'; i++)
++ if (local_path[i] == '/') local_sl = i;
++
++ if (local_sl == -1) {
++ strcpy(local_fname, local_path);
++ } else {
++ temp = local_path + local_sl;
++ strcpy(local_fname, temp);
++ }
++
++ if (server_fname[0] == '\0')
++ strcpy (server_fname, local_fname);
++
+ /* Connect to the data socket */
+ if (ftpcmd("PASV", NULL, control_stream, buf) != 227) {
+ bb_error_msg_and_die("PASV error: %s", buf + 4);
+ }
+ fd_data = xconnect_ftpdata(server, buf);
+
+- if (ftpcmd("CWD ", server_path, control_stream, buf) != 250) {
+- bb_error_msg_and_die("CWD error: %s", buf + 4);
+- }
++ if (server_sl != -1)
++ if (ftpcmd("CWD ", server_fpath, control_stream, buf) != 250) {
++ bb_error_msg_and_die("CWD error: %s", buf + 4);
++ }
+
+ /* get the local file */
+ if ((local_path[0] == '-') && (local_path[1] == '\0')) {
+@@ -260,7 +296,7 @@
+ break;
+ }
+ }
+- response = ftpcmd("STOR ", local_path, control_stream, buf);
++ response = ftpcmd("STOR ", server_fname, control_stream, buf);
+ switch (response) {
+ case 125:
+ case 150: