From 53c1e5069c952812b429d7c141cf201edf6afaae Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 8 Feb 2012 17:47:46 +0100 Subject: [PATCH] Fix TidyProgramName A trailing .exe was not removed if the engine name was quoted. --- backend.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 0a736e7..92a228d 100644 --- a/backend.c +++ b/backend.c @@ -14648,7 +14648,7 @@ PrintOpponents (FILE *fp) void TidyProgramName (char *prog, char *host, char buf[MSG_SIZ]) { - char *p, *q; + char *p, *q, c; int local = (strcmp(host, "localhost") == 0); while (!local && (p = strchr(prog, ';')) != NULL) { p++; @@ -14665,7 +14665,8 @@ TidyProgramName (char *prog, char *host, char buf[MSG_SIZ]) while (p >= prog && *p != '/' && *p != '\\') p--; p++; if(p == prog && *p == '"') p++; - if (q - p >= 4 && StrCaseCmp(q - 4, ".exe") == 0) q -= 4; + c = *q; *q = 0; + if (q - p >= 4 && StrCaseCmp(q - 4, ".exe") == 0) *q = c, q -= 4; else *q = c; memcpy(buf, p, q - p); buf[q - p] = NULLCHAR; if (!local) { -- 1.7.0.4