From 6e23da9254965328a8a282814604d7df359d3852 Mon Sep 17 00:00:00 2001 From: hniksic Date: Wed, 1 Nov 2000 17:41:20 -0800 Subject: [PATCH] [svn] Hide password from URL when non-verbose, too. --- src/ChangeLog | 6 ++++++ src/ftp.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c9e45a49..9e0706cd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2000-11-02 Hrvoje Niksic + + * ftp.c (ftp_loop_internal): Hide the password from the URL when + printing non-verbose. Problem spotted by Dariusz Mlynarczyk + . + 2000-11-02 Junio Hamano * ftp-basic.c (ftp_login): Make comparison case-insensitive. diff --git a/src/ftp.c b/src/ftp.c index d2399311..3a19d019 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -996,8 +996,16 @@ ftp_loop_internal (struct urlinfo *u, struct fileinfo *f, ccon *con) } logprintf (LOG_VERBOSE, _("%s (%s) - `%s' saved [%ld]\n\n"), tms, tmrate, locf, len); - logprintf (LOG_NONVERBOSE, "%s URL: %s [%ld] -> \"%s\" [%d]\n", - tms, u->url, len, locf, count); + if (!opt.verbose && !opt.quiet) + { + /* Need to hide the password from the URL. The `if' is here + so that we don't do the needless allocation every + time. */ + char *hurl = str_url (u->proxy ? u->proxy : u, 1); + logprintf (LOG_NONVERBOSE, "%s URL: %s [%ld] -> \"%s\" [%d]\n", + tms, hurl, len, locf, count); + free (hurl); + } if ((con->cmd & DO_LIST)) /* This is a directory listing file. */