mirror of
https://github.com/mirror/wget.git
synced 2025-03-27 12:30:19 +08:00
Use stderr instead of stdout to prompt password.
This commit is contained in:
parent
e076a6d39d
commit
09bc5b5787
@ -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>
|
2011-02-22 Steven Schubiger <stsc@member.fsf.org>
|
||||||
|
|
||||||
* http.c (gethttp, http_loop): Move duplicated code which is run
|
* http.c (gethttp, http_loop): Move duplicated code which is run
|
||||||
|
@ -740,9 +740,9 @@ static char *
|
|||||||
prompt_for_password (void)
|
prompt_for_password (void)
|
||||||
{
|
{
|
||||||
if (opt.user)
|
if (opt.user)
|
||||||
printf (_("Password for user %s: "), quote (opt.user));
|
fprintf (stderr, _("Password for user %s: "), quote (opt.user));
|
||||||
else
|
else
|
||||||
printf (_("Password: "));
|
fprintf (stderr, _("Password: "));
|
||||||
return getpass("");
|
return getpass("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user