From e80744306c5b4e923e6e90c6464e1cd4987fdc92 Mon Sep 17 00:00:00 2001 From: des Date: Sat, 9 May 1998 08:56:07 +0000 Subject: Arrggghhhh... forgot to strip the / after outputting %2f --- usr.bin/fetch/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c index 571bd1e..2fe30ae 100644 --- a/usr.bin/fetch/main.c +++ b/usr.bin/fetch/main.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. */ -/* $Id: main.c,v 1.44 1998/02/20 05:11:42 jb Exp $ */ +/* $Id: main.c,v 1.45 1998/05/09 08:41:23 des Exp $ */ #include @@ -181,8 +181,11 @@ main(int argc, char *const *argv) strcpy(uri, "ftp://"); strcat(uri, hostname); strcat(uri, "/"); - if (change_to_dir[0] == '/') strcat(uri, "%2f"); - strcat(uri, change_to_dir); + if (change_to_dir[0] == '/') { + strcat(uri, "%2f"); + strcat(uri, change_to_dir+1); + } + else strcat(uri, change_to_dir); if (file_to_get[0] != '/' && uri[strlen(uri) - 1] != '/') strcat(uri, "/"); strcat(uri, file_to_get); -- cgit v1.1