From: H.G. Muller Date: Sun, 9 May 2010 20:07:30 +0000 (+0200) Subject: Fix bug in sending "usermove" when forcing book moves X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=1f7d5904dd33df6234de598651087809dc1cbd2f;p=xboard.git Fix bug in sending "usermove" when forcing book moves The keyword "usermove" was copied to the buffer, but not sent before it was overwritten by the actual book move. --- diff --git a/backend.c b/backend.c index 53799ec..36a7ea2 100644 --- a/backend.c +++ b/backend.c @@ -6962,8 +6962,7 @@ char *SendMoveToBookUser(int moveNr, ChessProgramState *cps, int initial) // after a book hit we never send 'go', and the code after the call to this routine // has '&& !bookHit' added to suppress potential sending there (based on 'firstMove'). char buf[MSG_SIZ]; - if (cps->useUsermove) sprintf(buf, "usermove "); // sorry, no SAN yet :( - sprintf(buf, "%s\n", bookHit); // force book move into program supposed to play it + sprintf(buf, "%s%s\n", (cps->useUsermove ? "usermove " : ""), bookHit); // force book move into program supposed to play it SendToProgram(buf, cps); if(!initial) firstMove = FALSE; // normally we would clear the firstMove condition after return & sending 'go' } else if(initial) { // 'go' was needed irrespective of firstMove, and it has to be done in this routine