summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libfetch/ftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index 2aeecbb..83667ae 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -325,8 +325,9 @@ _ftp_transfer(int cd, char *oper, char *file,
verbose = (flags && strchr(flags, 'v'));
/* passive mode */
- if (!pasv && (s = getenv("FTP_PASSIVE_MODE")) != NULL)
- pasv = (strncasecmp(s, "no", 2) != 0);
+ if (!pasv)
+ pasv = ((s = getenv("FTP_PASSIVE_MODE")) == NULL ||
+ strncasecmp(s, "no", 2) != 0);
/* find our own address, bind, and listen */
l = sizeof sin;
OpenPOWER on IntegriCloud