зеркало из https://github.com/github/putty.git
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:
Родитель
5d27e5775c
Коммит
d0635e9d39
8
plink.c
8
plink.c
|
@ -370,13 +370,15 @@ int main(int argc, char **argv) {
|
|||
/*
|
||||
* One string.
|
||||
*/
|
||||
do_defaults (p, &cfg);
|
||||
if (cfg.host[0] == '\0') {
|
||||
Config cfg2;
|
||||
do_defaults (p, &cfg2);
|
||||
if (cfg2.host[0] == '\0') {
|
||||
/* No settings for this host; use defaults */
|
||||
strncpy(cfg.host, p, sizeof(cfg.host)-1);
|
||||
cfg.host[sizeof(cfg.host)-1] = '\0';
|
||||
cfg.port = 22;
|
||||
}
|
||||
} else
|
||||
cfg = cfg2;
|
||||
} else {
|
||||
*r++ = '\0';
|
||||
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);
|
||||
if (cfg.host[0] == '\0') {
|
||||
/* No settings for this host; use defaults */
|
||||
do_defaults(NULL, &cfg);
|
||||
strncpy(cfg.host, host, sizeof(cfg.host)-1);
|
||||
cfg.host[sizeof(cfg.host)-1] = '\0';
|
||||
cfg.port = 22;
|
||||
|
|
Загрузка…
Ссылка в новой задаче