From: H.G. Muller Date: Wed, 2 Mar 2011 21:23:21 +0000 (+0100) Subject: Fix bugs in FRC castling rights X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d652e590ebe341d1e9b35ab876569a72c13dfae7;p=xboard.git Fix bugs in FRC castling rights When parsing a castling move in FRC when no rights existed, the parser returned 0 (= EndOfFile) rather than ImpossibleMove. The recognition of the absence of rights was not adapted to the new encoding NoRights in stead of -1. --- diff --git a/parser.l b/parser.l index 9515fea..8ceaa55 100644 --- a/parser.l +++ b/parser.l @@ -756,7 +756,7 @@ extern void CopyBoard P((Board to, Board from)); { fprintf(debugFP, "Parser FRC long %d %d\n", ff, ft); }; - if(ff == NoRights || ft == NoRights) return 0; + if(ff == NoRights || ft == NoRights) return ImpossibleMove; } sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); if (appData.debugMode) { @@ -810,7 +810,7 @@ extern void CopyBoard P((Board to, Board from)); if (appData.debugMode) { fprintf(debugFP, "Parser FRC short %d %d\n", ff, ft); } - if(ff == NoRights || ft == NoRights) return 0; + if(ff == NoRights || ft == NoRights) return ImpossibleMove; } sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); if (appData.debugMode) {