diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-27 18:41:03 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-27 18:41:03 +0000 |
commit | d4424c7463ff0511fe5c55906b23e56bdf6caf65 (patch) | |
tree | 5ad5cd6dbace830667fc43ad6dbc8d581d14152b | |
parent | e35c3fcc6ebe2945bcf695cb9d3eeaa2460ecb04 (diff) | |
download | busybox-w32-d4424c7463ff0511fe5c55906b23e56bdf6caf65.tar.gz busybox-w32-d4424c7463ff0511fe5c55906b23e56bdf6caf65.tar.bz2 busybox-w32-d4424c7463ff0511fe5c55906b23e56bdf6caf65.zip |
Patch from Geoff Baker to fix bug http://bugs.busybox.net/view.php?id=905 by
changing wget's ftp code not to chdir but to use the complete path each time.
git-svn-id: svn://busybox.net/trunk/busybox@15533 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | networking/wget.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/networking/wget.c b/networking/wget.c index 6c1aa74b7..64cdf6220 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -6,27 +6,12 @@ | |||
6 | * | 6 | * |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <stdio.h> | 9 | #include "busybox.h" |
10 | #include <errno.h> | 10 | #include <errno.h> |
11 | #include <stdlib.h> | ||
12 | #include <unistd.h> | ||
13 | #include <ctype.h> | ||
14 | #include <string.h> | ||
15 | #include <strings.h> | ||
16 | #include <unistd.h> | ||
17 | #include <signal.h> | 11 | #include <signal.h> |
18 | #include <sys/ioctl.h> | 12 | #include <sys/ioctl.h> |
19 | |||
20 | #include <sys/types.h> | ||
21 | #include <sys/stat.h> | ||
22 | #include <sys/socket.h> | ||
23 | #include <netinet/in.h> | ||
24 | #include <arpa/inet.h> | ||
25 | #include <netdb.h> | ||
26 | |||
27 | #include <getopt.h> | 13 | #include <getopt.h> |
28 | 14 | ||
29 | #include "busybox.h" | ||
30 | 15 | ||
31 | struct host_info { | 16 | struct host_info { |
32 | char *host; | 17 | char *host; |
@@ -458,13 +443,12 @@ read_response: | |||
458 | close_delete_and_die("ftp login: %s", buf+4); | 443 | close_delete_and_die("ftp login: %s", buf+4); |
459 | } | 444 | } |
460 | 445 | ||
461 | ftpcmd("CDUP", NULL, sfp, buf); | ||
462 | ftpcmd("TYPE I", NULL, sfp, buf); | 446 | ftpcmd("TYPE I", NULL, sfp, buf); |
463 | 447 | ||
464 | /* | 448 | /* |
465 | * Querying file size | 449 | * Querying file size |
466 | */ | 450 | */ |
467 | if (ftpcmd("SIZE /", target.path, sfp, buf) == 213) { | 451 | if (ftpcmd("SIZE ", target.path, sfp, buf) == 213) { |
468 | unsigned long value; | 452 | unsigned long value; |
469 | if (safe_strtoul(buf+4, &value)) { | 453 | if (safe_strtoul(buf+4, &value)) { |
470 | close_delete_and_die("SIZE value is garbage"); | 454 | close_delete_and_die("SIZE value is garbage"); |
@@ -496,7 +480,7 @@ read_response: | |||
496 | filesize -= beg_range; | 480 | filesize -= beg_range; |
497 | } | 481 | } |
498 | 482 | ||
499 | if (ftpcmd("RETR /", target.path, sfp, buf) > 150) | 483 | if (ftpcmd("RETR ", target.path, sfp, buf) > 150) |
500 | close_delete_and_die("RETR: %s", buf+4); | 484 | close_delete_and_die("RETR: %s", buf+4); |
501 | } | 485 | } |
502 | 486 | ||