mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-20 20:45:02 -05:00
Plink and PSCP were failing to load the `Default Settings' options
when connecting to an arbitrary hostname. In particular, setting a default user name didn't work. Now it does. [originally from svn r747]
This commit is contained in:
parent
5d27e5775c
commit
d0635e9d39
8
plink.c
8
plink.c
@ -370,13 +370,15 @@ int main(int argc, char **argv) {
|
|||||||
/*
|
/*
|
||||||
* One string.
|
* One string.
|
||||||
*/
|
*/
|
||||||
do_defaults (p, &cfg);
|
Config cfg2;
|
||||||
if (cfg.host[0] == '\0') {
|
do_defaults (p, &cfg2);
|
||||||
|
if (cfg2.host[0] == '\0') {
|
||||||
/* No settings for this host; use defaults */
|
/* No settings for this host; use defaults */
|
||||||
strncpy(cfg.host, p, sizeof(cfg.host)-1);
|
strncpy(cfg.host, p, sizeof(cfg.host)-1);
|
||||||
cfg.host[sizeof(cfg.host)-1] = '\0';
|
cfg.host[sizeof(cfg.host)-1] = '\0';
|
||||||
cfg.port = 22;
|
cfg.port = 22;
|
||||||
}
|
} else
|
||||||
|
cfg = cfg2;
|
||||||
} else {
|
} else {
|
||||||
*r++ = '\0';
|
*r++ = '\0';
|
||||||
strncpy(cfg.username, p, sizeof(cfg.username)-1);
|
strncpy(cfg.username, p, sizeof(cfg.username)-1);
|
||||||
|
1
scp.c
1
scp.c
@ -444,6 +444,7 @@ static void do_cmd(char *host, char *user, char *cmd)
|
|||||||
do_defaults(host, &cfg);
|
do_defaults(host, &cfg);
|
||||||
if (cfg.host[0] == '\0') {
|
if (cfg.host[0] == '\0') {
|
||||||
/* No settings for this host; use defaults */
|
/* No settings for this host; use defaults */
|
||||||
|
do_defaults(NULL, &cfg);
|
||||||
strncpy(cfg.host, host, sizeof(cfg.host)-1);
|
strncpy(cfg.host, host, sizeof(cfg.host)-1);
|
||||||
cfg.host[sizeof(cfg.host)-1] = '\0';
|
cfg.host[sizeof(cfg.host)-1] = '\0';
|
||||||
cfg.port = 22;
|
cfg.port = 22;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user