mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-29 15:54:48 -05:00
Make PSFTP use console_get_line() to fetch username, so that that prompt is
affected by `-batch'. [originally from svn r4833]
This commit is contained in:
parent
739de21c6d
commit
da1dfe64bf
7
psftp.c
7
psftp.c
@ -1907,10 +1907,9 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
|
|||||||
cfg.username[sizeof(cfg.username) - 1] = '\0';
|
cfg.username[sizeof(cfg.username) - 1] = '\0';
|
||||||
}
|
}
|
||||||
if (!cfg.username[0]) {
|
if (!cfg.username[0]) {
|
||||||
printf("login as: ");
|
if (!console_get_line("login as: ",
|
||||||
fflush(stdout);
|
cfg.username, sizeof(cfg.username), FALSE)) {
|
||||||
if (!fgets(cfg.username, sizeof(cfg.username), stdin)) {
|
fprintf(stderr, "psftp: no username, aborting\n");
|
||||||
fprintf(stderr, "psftp: aborting\n");
|
|
||||||
cleanup_exit(1);
|
cleanup_exit(1);
|
||||||
} else {
|
} else {
|
||||||
int len = strlen(cfg.username);
|
int len = strlen(cfg.username);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user