summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-11-27 13:42:56 +0000
committerdes <des@FreeBSD.org>2000-11-27 13:42:56 +0000
commitaf385a33a04e217f7b41ec87bc8e923cda70582f (patch)
treeb6c6c920d2b89f67892c289520aefd5987544132 /lib
parent7affcbe9bea8f05e53b122665b694e9657a4c7c5 (diff)
downloadFreeBSD-src-af385a33a04e217f7b41ec87bc8e923cda70582f.zip
FreeBSD-src-af385a33a04e217f7b41ec87bc8e923cda70582f.tar.gz
Fix old-style proxy specs: default to FTP if FTP_PROXY was set; only default
to HTTP if HTTP_PROXY was used instead.
Diffstat (limited to 'lib')
-rw-r--r--lib/libfetch/ftp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index ab2c54d..d9f624e 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -876,8 +876,12 @@ _ftp_get_proxy(void)
if (((p = getenv("FTP_PROXY")) || (p = getenv("HTTP_PROXY"))) &&
*p && (purl = fetchParseURL(p)) != NULL) {
- if (!*purl->scheme)
- strcpy(purl->scheme, SCHEME_HTTP);
+ if (!*purl->scheme) {
+ if (getenv("FTP_PROXY"))
+ strcpy(purl->scheme, SCHEME_FTP);
+ else
+ strcpy(purl->scheme, SCHEME_HTTP);
+ }
if (!purl->port)
purl->port = _fetch_default_proxy_port(purl->scheme);
if (strcasecmp(purl->scheme, SCHEME_FTP) == 0 ||
OpenPOWER on IntegriCloud