Patch from RDB: in the case where the protocol read from the
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Sep 2001 22:45:05 +0000 (22:45 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 7 Sep 2001 22:45:05 +0000 (22:45 +0000)
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

index d2ba357..16442db 100644 (file)
@@ -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;
        }