mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-23 14:05:03 -05:00
Patch from RDB: in the case where the protocol read from the
settings file is unrecognised (i.e. PuTTYtel reading PuTTY's registry), fall back to the default _port_ as well as the default protocol. [originally from svn r1242]
This commit is contained in:
parent
e1ecb1c61e
commit
eebec27c99
@ -291,7 +291,6 @@ void load_settings(char *section, int do_host, Config * cfg)
|
|||||||
cfg->remote_cmd_ptr2 = NULL;
|
cfg->remote_cmd_ptr2 = NULL;
|
||||||
|
|
||||||
gpps(sesskey, "HostName", "", cfg->host, sizeof(cfg->host));
|
gpps(sesskey, "HostName", "", cfg->host, sizeof(cfg->host));
|
||||||
gppi(sesskey, "PortNumber", default_port, &cfg->port);
|
|
||||||
gpps(sesskey, "LogFileName", "putty.log",
|
gpps(sesskey, "LogFileName", "putty.log",
|
||||||
cfg->logfilename, sizeof(cfg->logfilename));
|
cfg->logfilename, sizeof(cfg->logfilename));
|
||||||
gppi(sesskey, "LogType", 0, &cfg->logtype);
|
gppi(sesskey, "LogType", 0, &cfg->logtype);
|
||||||
@ -299,9 +298,11 @@ void load_settings(char *section, int do_host, Config * cfg)
|
|||||||
|
|
||||||
gpps(sesskey, "Protocol", "default", prot, 10);
|
gpps(sesskey, "Protocol", "default", prot, 10);
|
||||||
cfg->protocol = default_protocol;
|
cfg->protocol = default_protocol;
|
||||||
|
cfg->port = default_port;
|
||||||
for (i = 0; backends[i].name != NULL; i++)
|
for (i = 0; backends[i].name != NULL; i++)
|
||||||
if (!strcmp(prot, backends[i].name)) {
|
if (!strcmp(prot, backends[i].name)) {
|
||||||
cfg->protocol = backends[i].protocol;
|
cfg->protocol = backends[i].protocol;
|
||||||
|
gppi(sesskey, "PortNumber", default_port, &cfg->port);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user