From: simon Date: Sun, 13 May 2001 13:23:12 +0000 (+0000) Subject: Trim leading whitespace off the hostname if it's there. X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/381b1876bb2fb230d7ada8d64479da7f207bb159 Trim leading whitespace off the hostname if it's there. git-svn-id: svn://svn.tartarus.org/sgt/putty@1120 cda61777-01e9-0310-a592-d414129be87e --- 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, '@');