From e10e26b893f28c034d830fdc57487453325306f5 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sat, 21 May 2016 18:38:58 +0200 Subject: [PATCH] Join name and version when in separate 'id' commands If an engine issues an "id version" command when an "id name" was already received, a new 'myname' feature is emitted that contains both name and version number. This is supposed to overrule the bare name in the myname feature emitted because of the "id name" command. --- UCI2WB.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index ac6f788..145a96c 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -341,8 +341,9 @@ Engine2GUI() if(buf[0]) printf("%s", buf); } else if(!strcmp(command, "id")) { - char name[256]; + static char name[256], version[256]; if(sscanf(line, "id name %[^\n]", name) == 1) printf("feature myname=\"%s (U%cI2WB)\"\n", name, sc-32); + if(sscanf(line, "id version %[^\n]", version) == 1 && *name) printf("feature myname=\"%s %s (U%cI2WB)\"\n", name, version, sc-32); } else if(!strcmp(command, "readyok")) { pause = 0; Sync(WAKEUP); } // resume processing of GUI commands else if(sc == 'x'&& !strcmp(command, "ucciok") || sscanf(command, "u%ciok", &c)==1 && c==sc) { -- 1.7.0.4