diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-31 23:04:08 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-31 23:04:08 +0000 |
commit | aa3be9076a77ac87c5503d598b2ac53679418e66 (patch) | |
tree | e466f8191a54bbd519f0ad830a6397d974c505de /usr.bin/ftp/fetch.c | |
parent | df9c83489366e6518426547c5388edf5e374118a (diff) |
Treat empty environment variables the same as NULL. henning@ OK
Diffstat (limited to 'usr.bin/ftp/fetch.c')
-rw-r--r-- | usr.bin/ftp/fetch.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index e7e805c2b3f..62a97c948d9 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.44 2003/03/10 06:20:10 itojun Exp $ */ +/* $OpenBSD: fetch.c,v 1.45 2003/03/31 23:04:07 millert Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -38,7 +38,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: fetch.c,v 1.44 2003/03/10 06:20:10 itojun Exp $"; +static char rcsid[] = "$OpenBSD: fetch.c,v 1.45 2003/03/31 23:04:07 millert Exp $"; #endif /* not lint */ /* @@ -630,8 +630,10 @@ auto_fetch(argc, argv, outfile) (void)signal(SIGINT, (sig_t)intr); (void)signal(SIGPIPE, (sig_t)lostpeer); - ftpproxy = getenv(FTP_PROXY); - httpproxy = getenv(HTTP_PROXY); + if ((ftpproxy = getenv(FTP_PROXY)) != NULL && *ftpproxy == '\0') + ftpproxy = NULL; + if ((httpproxy = getenv(HTTP_PROXY)) != NULL && *httpproxy == '\0') + httpproxy = NULL; /* * Loop through as long as there's files to fetch. |