From: H.G. Muller Date: Thu, 7 Mar 2013 17:11:31 +0000 (+0100) Subject: Provide compatibility with Alien Edition setup command X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=afd156a1044364cc19d92b6c84e5d2ea030a9066;p=xboard.git Provide compatibility with Alien Edition setup command The setup command of the Alien Edition has a board-size specifier (possibly as prefix on a parent-variant name) between pieceToCharTable and FEN. The regular version would choke on that, precluding engines designed for the Alien protocol extension to have their setup processed when running under regular XBoard. This patch makes it skip the extra info. --- diff --git a/backend.c b/backend.c index b3c152e..4af9b0a 100644 --- a/backend.c +++ b/backend.c @@ -8436,6 +8436,7 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. if(appData.icsActive || forwardMostMove != 0 || cps != &first) return; if(sscanf(message, "setup (%s", buf) == 1) s = 8 + strlen(buf), buf[s-9] = NULLCHAR, SetCharTable(pieceToChar, buf); if(startedFromSetupPosition) return; + if(sscanf(message+s, "%dx%d+%d", &dummy, &dummy, &dummy) == 3) while(message[s] && message[s++] != ' '); // for compatibility with Alien Edition ParseFEN(boards[0], &dummy, message+s); DrawPosition(TRUE, boards[0]); startedFromSetupPosition = TRUE;