1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Use stderr instead of stdout to prompt password.

This commit is contained in:
Gilles Carry 2011-02-24 09:40:31 +01:00 committed by Giuseppe Scrivano
parent e076a6d39d
commit 09bc5b5787
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2011-02-22 Gilles Carry <gilles dot carry at st dot com>
* main.c (prompt_for_password): Use stderr instead of stdout
to prompt password. This allows to use --output-document=- and
--ask-password simultaneously. Without this, redirecting stdout
makes password prompt invisible and mucks up payload such as in
this example:
wget --output-document=- --ask-password -user=foo \
http://foo.com/tarball.tgz | tar zxf -
2011-02-22 Steven Schubiger <stsc@member.fsf.org>
* http.c (gethttp, http_loop): Move duplicated code which is run

View File

@ -740,9 +740,9 @@ static char *
prompt_for_password (void)
{
if (opt.user)
printf (_("Password for user %s: "), quote (opt.user));
fprintf (stderr, _("Password for user %s: "), quote (opt.user));
else
printf (_("Password: "));
fprintf (stderr, _("Password: "));
return getpass("");
}