when connecting to an arbitrary hostname. In particular, setting a
default user name didn't work. Now it does.
git-svn-id: svn://svn.tartarus.org/sgt/putty@747
cda61777-01e9-0310-a592-
d414129be87e
/*
* 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);
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;