Trim leading whitespace off the hostname if it's there.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 13 May 2001 13:23:12 +0000 (13:23 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 13 May 2001 13:23:12 +0000 (13:23 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1120 cda61777-01e9-0310-a592-d414129be87e

window.c

index 761097e..269d08f 100644 (file)
--- 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, '@');