X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/33f07e9636e80bb17f25f97145ca2e0eb262db30..18e62ad8969d5b38cfdc28c943f05c59ea7fba5d:/unix/uxplink.c diff --git a/unix/uxplink.c b/unix/uxplink.c index 6bf2c858..c9b50759 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -270,6 +270,7 @@ int main(int argc, char **argv) * Process the command line. */ do_defaults(NULL, &cfg); + loaded_session = FALSE; default_protocol = cfg.protocol; default_port = cfg.port; errors = 0; @@ -396,13 +397,15 @@ int main(int argc, char **argv) */ Config cfg2; do_defaults(p, &cfg2); - if (cfg2.host[0] == '\0') { + if (loaded_session || cfg2.host[0] == '\0') { /* No settings for this host; use defaults */ + /* (or session was already loaded with -load) */ strncpy(cfg.host, p, sizeof(cfg.host) - 1); cfg.host[sizeof(cfg.host) - 1] = '\0'; cfg.port = default_port; } else { cfg = cfg2; + /* Ick: patch up internal pointer after copy */ cfg.remote_cmd_ptr = cfg.remote_cmd; } } else {