From: H.G. Muller Date: Mon, 10 Dec 2012 12:28:37 +0000 (+0100) Subject: Fix -fSAN in AnalyzeFile mode X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=961180c518bc7939a4b35dcb9f651176a6141e48;p=xboard.git Fix -fSAN in AnalyzeFile mode The exception that a PV relates to currentMove rather than forwardMostMove applies not oly in AnalyzeMode, but also in AnalyzeFile. Furthermore, PvToSan did not properly restore the pushed game tail in this case. --- diff --git a/backend.c b/backend.c index 7f9b664..4b09ab8 100644 --- a/backend.c +++ b/backend.c @@ -5415,7 +5415,8 @@ ParsePV (char *pv, Boolean storeComments, Boolean atEnd) Boolean valid; int nr = 0; - if (gameMode == AnalyzeMode && currentMove < forwardMostMove) { + lastParseAttempt = pv; if(!*pv) return; // turns out we crash when we parse an empty PV + if ((gameMode == AnalyzeMode || gameMode == AnalyzeFile) && currentMove < forwardMostMove) { PushInner(currentMove, forwardMostMove); // [HGM] engine might not be thinking on forwardMost position! pushed = TRUE; } @@ -5520,7 +5521,7 @@ PvToSAN (char *pv) static char buf[10*MSG_SIZ]; int i, k=0, savedEnd=endPV, saveFMM = forwardMostMove; *buf = NULLCHAR; - if(forwardMostMove < endPV) PushInner(forwardMostMove, endPV); + if(forwardMostMove < endPV) PushInner(forwardMostMove, endPV); // shelve PV of PV-walk ParsePV(pv, FALSE, 2); // this appends PV to game, suppressing any display of it for(i = forwardMostMove; i