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