]> sjero.net Git - wget/commitdiff
[svn] Treat empty proxy environment vars as unset.
authorhniksic <devnull@localhost>
Thu, 26 Apr 2001 10:11:49 +0000 (03:11 -0700)
committerhniksic <devnull@localhost>
Thu, 26 Apr 2001 10:11:49 +0000 (03:11 -0700)
Published in <sxssniwq8d6.fsf@florida.arsdigita.de>.

src/ChangeLog
src/url.c

index a6bb7086b171072ce533208c854fbb22492c60d0..dba698e620660dd5881e5e59290e23b42873271c 100644 (file)
@@ -1,3 +1,7 @@
+2001-04-26  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * url.c (getproxy): Ignore empty proxy vars.
+
 2001-04-25  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * http.c (http_loop): Would load cookies every time.
index 3629cb9384f6aa885f8999bb4773782adccc5062..a670fe8511689906969c4e22df027211d9e99fe6 100644 (file)
--- 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?  */