diff options
Diffstat (limited to 'networking/wget.c')
-rw-r--r-- | networking/wget.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/networking/wget.c b/networking/wget.c index 58801ee..c95271b 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -56,10 +56,18 @@ int wget_main(int argc, char **argv) usage(wget_usage); } } - if (do_continue && !fname_out) - fatalError("wget: cannot specify continue (-c) without a filename (-O)\n"); + if (argc - optind != 1) usage(wget_usage); + + /* Guess an output filename */ + if (!fname_out) { + fname_out = get_last_path_component(argv[optind]); + } + + if (do_continue && !fname_out) + fatalError("wget: cannot specify continue (-c) without a filename (-O)\n"); + /* * Parse url into components. */ |