X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/5eaf1e061d83bdfe4f0f16a21bdccfedf070ee3e..381b1876bb2fb230d7ada8d64479da7f207bb159:/window.c diff --git a/window.c b/window.c index 761097e5..269d08f8 100644 --- a/window.c +++ b/window.c @@ -302,6 +302,14 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } } + /* + * Trim leading whitespace off the hostname if it's there. + */ + { + int space = strspn(cfg.host, " \t"); + memmove(cfg.host, cfg.host+space, 1+strlen(cfg.host)-space); + } + /* See if host is of the form user@host */ if (cfg.host[0] != '\0') { char *atsign = strchr(cfg.host, '@');