From f317611e5572e4292e3ee88f6956a97fcd794089 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 20 Oct 2000 13:23:24 +0000 Subject: [PATCH] Trim trailing whitespace off saved session names on the command line git-svn-id: svn://svn.tartarus.org/sgt/putty@728 cda61777-01e9-0310-a592-d414129be87e --- window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/window.c b/window.c index 89a8c118..74339b45 100644 --- a/window.c +++ b/window.c @@ -198,6 +198,10 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { * An initial @ means to activate a saved session. */ if (*p == '@') { + int i = strlen(p); + while (i > 1 && isspace(p[i-1])) + i--; + p[i] = '\0'; do_defaults (p+1, &cfg); if (!*cfg.host && !do_config()) { WSACleanup(); -- 2.11.0