diff options
-rw-r--r-- | lib/libfetch/ftp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c index 59d7190..da4f7ce 100644 --- a/lib/libfetch/ftp.c +++ b/lib/libfetch/ftp.c @@ -762,6 +762,8 @@ _ftp_connect(struct url *url, struct url *purl, char *flags) /* send user name and password */ user = url->user; if (!user || !*user) + user = getenv("FTP_LOGIN"); + if (!user || !*user) user = FTP_ANONYMOUS_USER; if (purl && url->port == _fetch_default_port(url->scheme)) e = _ftp_cmd(cd, "USER %s@%s", user, url->host); |