X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4123fa9acad10cd0bab8aded6e336b280ea2e95b..211d84da9aff9c324b12f274d82cf2dc35348750:/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. */