1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-05-09 21:52:10 -05:00

From trunk:

cvs up -j1.40 -j1.41 psftp.c [svn merge -r1996:1997]
Fix pscp-cmdline-port-bug for PSFTP too. (Also removes what appears to be a
gratuitous re-implementation of the "-l user" option.)

[originally from svn r1998]
This commit is contained in:
Jacob Nevins 2002-10-07 17:33:01 +00:00
parent 430edda8ea
commit 7ae0dbde80

15
psftp.c
View File

@ -1690,7 +1690,15 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
do_defaults(NULL, &cfg);
strncpy(cfg.host, host, sizeof(cfg.host) - 1);
cfg.host[sizeof(cfg.host) - 1] = '\0';
cfg.port = 22;
}
/*
* Force use of SSH. (If they got the protocol wrong we assume the
* port is useless too.)
*/
if (cfg.protocol != PROT_SSH) {
cfg.protocol = PROT_SSH;
cfg.port = 22;
}
/*
@ -1741,9 +1749,6 @@ static int psftp_connect(char *userhost, char *user, int portnumber)
}
}
if (cfg.protocol != PROT_SSH)
cfg.port = 22;
if (portnumber)
cfg.port = portnumber;
@ -1852,8 +1857,6 @@ int main(int argc, char *argv[])
} else if (strcmp(argv[i], "-h") == 0 ||
strcmp(argv[i], "-?") == 0) {
usage();
} else if (strcmp(argv[i], "-l") == 0 && i + 1 < argc) {
user = argv[++i];
} else if (strcmp(argv[i], "-batch") == 0) {
console_batch_mode = 1;
} else if (strcmp(argv[i], "-b") == 0 && i + 1 < argc) {