From a93d3ba04a4cff375cba07c37858e5b1061e90cc Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 1 Mar 2011 23:42:34 +0100 Subject: [PATCH] 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. --- parser.l | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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) { -- 1.7.0.4