X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/faf5762875a834c660fb6a8d89c23cb7bb3f6082..ffa79828fe69957be5910db025e26a10be94954d:/window.c diff --git a/window.c b/window.c index ac8ac85c..04d3d61f 100644 --- a/window.c +++ b/window.c @@ -272,8 +272,17 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) char *p; int got_host = 0; - default_protocol = DEFAULT_PROTOCOL; - default_port = DEFAULT_PORT; + default_protocol = be_default_protocol; + /* Find the appropriate default port. */ + { + default_port = 0; /* illegal */ + int i; + for (i = 0; backends[i].backend != NULL; i++) + if (backends[i].protocol == default_protocol) { + default_port = backends[i].backend->default_port; + break; + } + } cfg.logtype = LGTYP_NONE; do_defaults(NULL, &cfg);