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:
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>
|
||||
|
||||
* http.c (gethttp, http_loop): Move duplicated code which is run
|
||||
|
@ -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("");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user