From: H.G. Muller Date: Tue, 1 Mar 2011 22:42:34 +0000 (+0100) Subject: Fix parsing bug of FRC castling X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a93d3ba04a4cff375cba07c37858e5b1061e90cc;p=xboard.git Fix parsing bug of FRC castling The code that was supposed to intercept castling when no rights existed in FRC was not adapted to the new encoding for this by NoRights, rather than -1, and furthermore returned 0 (= EndOfFile) rather than ImpossibleMove. Not sure if the former would manifest itself in any way, but the latter seems bad. --- diff --git a/parser.l b/parser.l index 392b5b2..9515fea 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 < 0 || ft < 0) return 0; + if(ff == NoRights || ft == NoRights) return 0; } 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 < 0 || ft < 0) return 0; + if(ff == NoRights || ft == NoRights) return 0; } sprintf(currentMoveString, "%c%c%c%c",ff+AAA,rf+ONE,ft+AAA,rt+ONE); if (appData.debugMode) {