aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-02 23:19:38 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-02 23:19:38 +0000
commit25b669c144949816d3c9726c79dbd6e93d53ee8b (patch)
tree74f90fad907796eb599aeb495e223703f2cd741c
parentba1ff9b4eb4085b656a65df870865eeeb565fe5e (diff)
downloadbusybox-w32-25b669c144949816d3c9726c79dbd6e93d53ee8b.tar.gz
busybox-w32-25b669c144949816d3c9726c79dbd6e93d53ee8b.tar.bz2
busybox-w32-25b669c144949816d3c9726c79dbd6e93d53ee8b.zip
Try to guess an output filename
-rw-r--r--networking/wget.c12
-rw-r--r--wget.c12
2 files changed, 20 insertions, 4 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 58801ee47..c95271b0d 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -56,10 +56,18 @@ int wget_main(int argc, char **argv)
56 usage(wget_usage); 56 usage(wget_usage);
57 } 57 }
58 } 58 }
59 if (do_continue && !fname_out) 59
60 fatalError("wget: cannot specify continue (-c) without a filename (-O)\n");
61 if (argc - optind != 1) 60 if (argc - optind != 1)
62 usage(wget_usage); 61 usage(wget_usage);
62
63 /* Guess an output filename */
64 if (!fname_out) {
65 fname_out = get_last_path_component(argv[optind]);
66 }
67
68 if (do_continue && !fname_out)
69 fatalError("wget: cannot specify continue (-c) without a filename (-O)\n");
70
63 /* 71 /*
64 * Parse url into components. 72 * Parse url into components.
65 */ 73 */
diff --git a/wget.c b/wget.c
index 58801ee47..c95271b0d 100644
--- a/wget.c
+++ b/wget.c
@@ -56,10 +56,18 @@ int wget_main(int argc, char **argv)
56 usage(wget_usage); 56 usage(wget_usage);
57 } 57 }
58 } 58 }
59 if (do_continue && !fname_out) 59
60 fatalError("wget: cannot specify continue (-c) without a filename (-O)\n");
61 if (argc - optind != 1) 60 if (argc - optind != 1)
62 usage(wget_usage); 61 usage(wget_usage);
62
63 /* Guess an output filename */
64 if (!fname_out) {
65 fname_out = get_last_path_component(argv[optind]);
66 }
67
68 if (do_continue && !fname_out)
69 fatalError("wget: cannot specify continue (-c) without a filename (-O)\n");
70
63 /* 71 /*
64 * Parse url into components. 72 * Parse url into components.
65 */ 73 */