From 751750e3ee0195eef802a1554e97712285bf8fd7 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 8 Oct 2004 08:27:40 +0000 Subject: Patch from Denis Vlasenko to fix a problem where wget http://1.2.3.4/abc/ loses last '/' --- networking/wget.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'networking') diff --git a/networking/wget.c b/networking/wget.c index e233daf05..45acef4d6 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -239,11 +239,15 @@ int wget_main(int argc, char **argv) /* Guess an output filename */ if (!fname_out) { - fname_out = + // Dirty hack. Needed because bb_get_last_path_component + // will destroy trailing / by storing '\0' in last byte! + if(target.path[strlen(target.path)-1]!='/') { + fname_out = #ifdef CONFIG_FEATURE_WGET_STATUSBAR - curfile = + curfile = #endif - bb_get_last_path_component(target.path); + bb_get_last_path_component(target.path); + } if (fname_out==NULL || strlen(fname_out)<1) { fname_out = #ifdef CONFIG_FEATURE_WGET_STATUSBAR @@ -850,7 +854,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.74 2004/04/14 17:51:24 andersen Exp $ + * $Id: wget.c,v 1.75 2004/10/08 08:27:40 andersen Exp $ */ -- cgit v1.2.3