summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-04-18 18:56:50 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-04-18 18:56:50 +0000
commit86c39c6d6ab42a00a38159bb29327e1437001c8d (patch)
tree76c1363f189a852d16e22162f74a05a3f063c0a8
parentceefd3c9184ed70b29d9c9b3c14639ea9df024df (diff)
Fix problem when fetching files with -a.
-rw-r--r--usr.bin/ftp/fetch.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 9be8b18392b..b875b4cfc34 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.8 1997/04/16 05:02:48 millert Exp $ */
+/* $OpenBSD: fetch.c,v 1.9 1997/04/18 18:56:49 millert Exp $ */
/* $NetBSD: fetch.c,v 1.6 1997/04/14 09:09:19 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.8 1997/04/16 05:02:48 millert Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.9 1997/04/18 18:56:49 millert Exp $";
#endif /* not lint */
/*
@@ -244,9 +244,7 @@ url_get(line, proxyenv)
}
buf[buflen - 1] = '\0'; /* sanity */
- /*
- * Look for the "Content-length: " header.
- */
+ /* Look for the "Content-length: " header. */
#define CONTENTLEN "Content-Length: "
for (cp = buf; *cp != '\0'; cp++) {
if (tolower(*cp) == 'c' &&
@@ -433,8 +431,10 @@ auto_fetch(argc, argv)
/* Look for [user:pass@]host[:port] */
user = host;
pass = strpbrk(user, ":@/");
- if (pass == NULL || *pass == '/')
+ if (pass == NULL || *pass == '/') {
+ user = pass = NULL;
goto parsed_url;
+ }
if (*pass == '@') {
warnx("Bad ftp URL: %s", argv[argpos]);
rval = argpos + 1;
@@ -467,7 +467,7 @@ parsed_url:
}
/*
- * If cp is NULL, the file wasn't specified
+ * If dir is NULL, the file wasn't specified
* (URL looked something like ftp://host)
*/
if (dir != NULL)