diff options
author | 1997-04-14 00:48:44 +0000 | |
---|---|---|
committer | 1997-04-14 00:48:44 +0000 | |
commit | 47c33ce9a9db1e2a96e404297aa359a0c0b2ef9a (patch) | |
tree | 30935e49a604442bfc49ef8431955e9c4493f3f1 | |
parent | Use an offset parameter when loading the reg_map--some cards use the "other" (diff) | |
download | wireguard-openbsd-47c33ce9a9db1e2a96e404297aa359a0c0b2ef9a.tar.xz wireguard-openbsd-47c33ce9a9db1e2a96e404297aa359a0c0b2ef9a.zip |
URL specifiers are case insensitive. Noticed by Theo.
-rw-r--r-- | usr.bin/ftp/fetch.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index 144dc7ca2d4..35dd41b09d1 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.6 1997/04/10 00:17:08 millert Exp $ */ +/* $OpenBSD: fetch.c,v 1.7 1997/04/14 00:48:44 millert Exp $ */ /* $NetBSD: fetch.c,v 1.5 1997/04/05 03:27:36 lukem Exp $ */ /*- @@ -38,7 +38,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: fetch.c,v 1.6 1997/04/10 00:17:08 millert Exp $"; +static char rcsid[] = "$OpenBSD: fetch.c,v 1.7 1997/04/14 00:48:44 millert Exp $"; #endif /* not lint */ /* @@ -97,9 +97,9 @@ url_get(line, proxyenv) s = -1; proxy = NULL; - if (strncmp(line, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) + if (strncasecmp(line, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) host = line + sizeof(HTTP_URL) - 1; - else if (strncmp(line, FTP_URL, sizeof(FTP_URL) - 1) == 0) + else if (strncasecmp(line, FTP_URL, sizeof(FTP_URL) - 1) == 0) host = line + sizeof(FTP_URL) - 1; else errx(1, "url_get: invalid url '%s'", line); @@ -123,9 +123,9 @@ url_get(line, proxyenv) proxy = strdup(proxyenv); if (proxy == NULL) errx(1, "Can't allocate memory for proxy url."); - if (strncmp(proxy, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) + if (strncasecmp(proxy, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) host = proxy + sizeof(HTTP_URL) - 1; - else if (strncmp(proxy, FTP_URL, sizeof(FTP_URL) - 1) == 0) + else if (strncasecmp(proxy, FTP_URL, sizeof(FTP_URL) - 1) == 0) host = proxy + sizeof(FTP_URL) - 1; else { warnx("Malformed proxy url: %s", proxy); @@ -408,7 +408,7 @@ auto_fetch(argc, argv) /* * Try HTTP URL-style arguments first. */ - if (strncmp(line, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) { + if (strncasecmp(line, HTTP_URL, sizeof(HTTP_URL) - 1) == 0) { if (url_get(line, httpproxy) == -1) rval = argpos + 1; continue; @@ -420,7 +420,7 @@ auto_fetch(argc, argv) * Finally, try host:file. */ host = line; - if (strncmp(line, FTP_URL, sizeof(FTP_URL) - 1) == 0) { + if (strncasecmp(line, FTP_URL, sizeof(FTP_URL) - 1) == 0) { if (ftpproxy) { if (url_get(line, ftpproxy) == -1) rval = argpos + 1; |