aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fetch
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>1998-05-09 08:41:23 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>1998-05-09 08:41:23 +0000
commit757c6582c18497a96e13e37716d7d45e59eec391 (patch)
tree556fc407f05b0e00f034e0ecbc75de2e6e4bab7f /usr.bin/fetch
parent9762206457cf4e43b2901545d3e6a96299062d5e (diff)
Notes
Diffstat (limited to 'usr.bin/fetch')
-rw-r--r--usr.bin/fetch/main.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/usr.bin/fetch/main.c b/usr.bin/fetch/main.c
index 76fc64d1a58e..571bd1e41f62 100644
--- a/usr.bin/fetch/main.c
+++ b/usr.bin/fetch/main.c
@@ -24,7 +24,7 @@
* SUCH DAMAGE.
*/
-/* $Id: main.c,v 1.43 1997/08/19 01:57:53 asami Exp $ */
+/* $Id: main.c,v 1.44 1998/02/20 05:11:42 jb Exp $ */
#include <sys/types.h>
@@ -177,16 +177,11 @@ main(int argc, char *const *argv)
}
uri = alloca(sizeof("ftp://") + strlen(hostname) +
- strlen(change_to_dir) + 2 + strlen(file_to_get));
+ strlen(change_to_dir) + 5 + strlen(file_to_get));
strcpy(uri, "ftp://");
strcat(uri, hostname);
- /*
- * XXX - we should %-map a leading `/' into `%2f', but for
- * anonymous FTP it is unlikely to matter. Still, it would
- * be better to follow the spec.
- */
- if (change_to_dir[0] != '/')
- strcat(uri, "/");
+ strcat(uri, "/");
+ if (change_to_dir[0] == '/') strcat(uri, "%2f");
strcat(uri, change_to_dir);
if (file_to_get[0] != '/' && uri[strlen(uri) - 1] != '/')
strcat(uri, "/");