From 1ff52e17c1e57a49f5df962a229bc6b7dbefcd4c Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 7 Sep 2001 22:45:05 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@1242 cda61777-01e9-0310-a592-d414129be87e --- settings.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/settings.c b/settings.c index d2ba3579..16442db0 100644 --- a/settings.c +++ b/settings.c @@ -291,7 +291,6 @@ void load_settings(char *section, int do_host, Config * cfg) cfg->remote_cmd_ptr2 = NULL; gpps(sesskey, "HostName", "", cfg->host, sizeof(cfg->host)); - gppi(sesskey, "PortNumber", default_port, &cfg->port); gpps(sesskey, "LogFileName", "putty.log", cfg->logfilename, sizeof(cfg->logfilename)); 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); cfg->protocol = default_protocol; + cfg->port = default_port; for (i = 0; backends[i].name != NULL; i++) if (!strcmp(prot, backends[i].name)) { cfg->protocol = backends[i].protocol; + gppi(sesskey, "PortNumber", default_port, &cfg->port); break; } -- 2.11.0