X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/d1929fa48a10b01ccf2f251a4a7263569ba15a68..e1bb41d15291da414f744bad92e74a5169876b6c:/psftp.c diff --git a/psftp.c b/psftp.c index 079a61f3..e5374c5f 100644 --- a/psftp.c +++ b/psftp.c @@ -2067,6 +2067,15 @@ int psftp_main(int argc, char *argv[]) back = NULL; /* + * If the loaded session provides a hostname, and a hostname has not + * otherwise been specified, pop it in `userhost' so that + * `psftp -load sessname' is sufficient to start a session. + */ + if (!userhost && cfg.host[0] != '\0') { + userhost = dupstr(cfg.host); + } + + /* * If a user@host string has already been provided, connect to * it now. */