aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2001-06-21 19:45:06 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2001-06-21 19:45:06 +0000
commit8071c021311afb592bb6710b841350018ba97b9d (patch)
tree8c4977f9b0a6a58e97813de86bcaf2196eb833f2 /networking
parentceeff7381929930fe8d7e33543e285d5fdcf1c68 (diff)
downloadbusybox-8071c021311afb592bb6710b841350018ba97b9d.tar.gz
busybox-8071c021311afb592bb6710b841350018ba97b9d.tar.bz2
Add wget -P support, finishing off bug #1176
-Erik
Diffstat (limited to 'networking')
-rw-r--r--networking/wget.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/networking/wget.c b/networking/wget.c
index 6fd170d4d..61945b7d1 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -160,6 +160,7 @@ int wget_main(int argc, char **argv)
int n, try=5, status;
int port;
char *proxy;
+ char *dir_prefix=NULL;
char *s, buf[512];
struct stat sbuf;
char extra_headers[1024];
@@ -188,11 +189,14 @@ int wget_main(int argc, char **argv)
/*
* Crack command line.
*/
- while ((n = getopt_long(argc, argv, "cqO:", long_options, &option_index)) != EOF) {
+ while ((n = getopt_long(argc, argv, "cqO:P:", long_options, &option_index)) != EOF) {
switch (n) {
case 'c':
++do_continue;
break;
+ case 'P':
+ dir_prefix = optarg;
+ break;
case 'q':
quiet_flag = TRUE;
break;
@@ -224,7 +228,6 @@ int wget_main(int argc, char **argv)
}
}
- fprintf(stderr, "extra_headers='%s'\n", extra_headers);
if (argc - optind != 1)
show_usage();
@@ -269,6 +272,7 @@ int wget_main(int argc, char **argv)
output = stdout;
quiet_flag = TRUE;
} else {
+ fname_out = concat_path_file(dir_prefix, fname_out);
output = xfopen(fname_out, (do_continue ? "a" : "w"));
}
@@ -812,7 +816,7 @@ progressmeter(int flag)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: wget.c,v 1.41 2001/05/16 15:40:48 kraai Exp $
+ * $Id: wget.c,v 1.42 2001/06/21 19:45:06 andersen Exp $
*/