From ae621c6770b82c99d6511149f5ba590881f2d708 Mon Sep 17 00:00:00 2001 From: hniksic Date: Thu, 26 Apr 2001 03:11:49 -0700 Subject: [PATCH] [svn] Treat empty proxy environment vars as unset. Published in . --- src/ChangeLog | 4 ++++ src/url.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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? */