X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=psftp.c;h=e5374c5f9a18409a9c8a1f99c5d01cef0455f520;hb=2efbd01b470e1e0e893d14cee259d6b02776a47d;hp=079a61f33eef8178ec1f6710f1319e43272f5bd4;hpb=55119c21670a0ddc604013f4321f3ffde073adff;p=PuTTY.git diff --git a/psftp.c b/psftp.c index 079a61f3..e5374c5f 100644 --- a/psftp.c +++ b/psftp.c @@ -2066,6 +2066,15 @@ int psftp_main(int argc, char *argv[]) argv += i; 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.