diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-10-02 23:19:38 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-10-02 23:19:38 +0000 |
commit | 96556303b85181257758e18b057ec27f2399be00 (patch) | |
tree | 74f90fad907796eb599aeb495e223703f2cd741c /wget.c | |
parent | c55226e8d620f4d6f36bc90869f8296954f94232 (diff) | |
download | busybox-w32-96556303b85181257758e18b057ec27f2399be00.tar.gz busybox-w32-96556303b85181257758e18b057ec27f2399be00.tar.bz2 busybox-w32-96556303b85181257758e18b057ec27f2399be00.zip |
Try to guess an output filename
git-svn-id: svn://busybox.net/trunk/busybox@1143 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'wget.c')
-rw-r--r-- | wget.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 | */ |