From 412a8de0295bf9cef6b02a6809dfda966cacd9d4 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 2 Jan 2011 14:17:32 +0100 Subject: [PATCH] Fix bug in parsing variations The moves parsed from a variation were stored in the moveList without appended linefeed. This caused errors if the variation extended to beyond the end of the main line,into a hitherto unused part of the move list, as the linefeed was then not there from the overwritten move. As a result moves sent to the engine were concatenated, triggering illegal-move messages and bringing the engine out of phase. --- backend.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index 410488b..e686722 100644 --- a/backend.c +++ b/backend.c @@ -4991,6 +4991,9 @@ fprintf(debugFP,"parsePV: %d %c%c%c%c yy='%s'\nPV = '%s'\n", valid, fromX+AAA, f moveList[endPV-1][1] = fromY + ONE; moveList[endPV-1][2] = toX + AAA; moveList[endPV-1][3] = toY + ONE; + moveList[endPV-1][4] = promoChar; + moveList[endPV-1][5] = NULLCHAR; + strncat(moveList[endPV-1], "\n", MOVE_LEN); if(storeComments) CoordsToAlgebraic(boards[endPV - 1], PosFlags(endPV - 1), -- 1.7.0.4