diff --git a/src/ChangeLog b/src/ChangeLog index a6bb7086..dba698e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-04-26 Hrvoje Niksic + + * url.c (getproxy): Ignore empty proxy vars. + 2001-04-25 Hrvoje Niksic * http.c (http_loop): Would load cookies every time. diff --git a/src/url.c b/src/url.c index 3629cb93..a670fe85 100644 --- a/src/url.c +++ b/src/url.c @@ -1286,16 +1286,21 @@ opt_url (struct urlinfo *u) char * getproxy (uerr_t proto) { + char *proxy; + if (proto == URLHTTP) - return opt.http_proxy ? opt.http_proxy : getenv ("http_proxy"); + proxy = opt.http_proxy ? opt.http_proxy : getenv ("http_proxy"); else if (proto == URLFTP) - return opt.ftp_proxy ? opt.ftp_proxy : getenv ("ftp_proxy"); + proxy = opt.ftp_proxy ? opt.ftp_proxy : getenv ("ftp_proxy"); #ifdef HAVE_SSL else if (proto == URLHTTPS) - return opt.https_proxy ? opt.https_proxy : getenv ("https_proxy"); + proxy = opt.https_proxy ? opt.https_proxy : getenv ("https_proxy"); #endif /* HAVE_SSL */ else + proxy = NULL; + if (!proxy || !*proxy) return NULL; + return proxy; } /* Should a host be accessed through proxy, concerning no_proxy? */