-/* $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 $ */
/*-
*/
#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 */
/*
}
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' &&
/* 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;
}
/*
- * 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)