X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/e8e8d6e2aaec02b9687ca8f2029bb6473acb0ec7..cae0c0233cb7c0180bfb7a5bca934b6e57805471:/plink.c diff --git a/plink.c b/plink.c index 0d79a984..589de1a0 100644 --- a/plink.c +++ b/plink.c @@ -458,6 +458,21 @@ int main(int argc, char **argv) */ cfg.host[strcspn(cfg.host, ":")] = '\0'; + /* + * Remove any remaining whitespace from the hostname. + */ + { + int p1 = 0, p2 = 0; + while (cfg.host[p2] != '\0') { + if (cfg.host[p2] != ' ' && cfg.host[p2] != '\t') { + cfg.host[p1] = cfg.host[p2]; + p1++; + } + p2++; + } + cfg.host[p1] = '\0'; + } + if (!*cfg.remote_cmd_ptr) flags |= FLAG_INTERACTIVE;