From: H.G.Muller Date: Sat, 21 May 2016 16:38:58 +0000 (+0200) Subject: Join name and version when in separate 'id' commands X-Git-Tag: v2.3~28 X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=commitdiff_plain;h=e10e26b893f28c034d830fdc57487453325306f5 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. --- 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) {