Hi, GNU wget: wget google.com // ok bb before: wget google.com // wget: not an http or ftp url
This costs 47 bytes here, but improves the usability quite a bit. - Lauri -- http://www.fastmail.fm - A no graphics, no pop-ups email service
From a89587e950bbfe1b3682a2c38405967f197a34e9 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <cur...@operamail.com> Date: Mon, 25 Nov 2013 20:53:12 +0200 Subject: [PATCH] wget: User-friendly fallback to http GNU wget: wget google.com // ok bb before: wget google.com // wget: not an http or ftp url Signed-off-by: Lauri Kasanen <cur...@operamail.com> --- networking/wget.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/networking/wget.c b/networking/wget.c index cfbacec..3c66665 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -282,6 +282,11 @@ static void parse_url(const char *src_url, struct host_info *h) h->port = bb_lookup_port("ftp", "tcp", 21); h->host = url + 6; h->is_ftp = 1; + } else if (!strstr(url, "//")) { + // GNU wget is user-friendly and falls back to http:// + h->port = bb_lookup_port("http", "tcp", 80); + h->host = url; + h->is_ftp = 0; } else bb_error_msg_and_die("not an http or ftp url: %s", sanitize_string(url)); -- 1.8.3.1
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox