Re: [PATCH] wget: User-friendly fallback to http

2013-12-17 Thread Denys Vlasenko
On Monday 25 November 2013 19:58, Lauri Kasanen wrote:
 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.

With a goto, it can be only 22 bytes :)

Applied, thanks!
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


Re: [PATCH] wget: User-friendly fallback to http

2013-12-16 Thread Lauri Kasanen
Hi Denys,

Ping on
http://lists.busybox.net/pipermail/busybox/2013-November/080038.html

If DESKTOP guards or something else is needed, please say.

- Lauri

-- 
http://www.fastmail.fm - The way an email service should be

___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[PATCH] wget: User-friendly fallback to http

2013-11-25 Thread Lauri Kasanen
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..3c5 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