From: H.G. Muller Date: Sun, 23 Oct 2011 13:53:32 +0000 (+0200) Subject: Fix PV walking with -fSAN X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2e25ba964f3e2faf1a328b3de269367c3bba8c58;p=xboard.git Fix PV walking with -fSAN The SAN options had broken the PV walking, because the shelving of the walked PV to create space for the conversion to SAN of an incoming PV would not be properly undone, but would add the walked PV to the game. --- diff --git a/backend.c b/backend.c index e0bb52f..cd344b6 100644 --- a/backend.c +++ b/backend.c @@ -5426,7 +5426,7 @@ char * PvToSAN(char *pv) { static char buf[10*MSG_SIZ]; - int i, k=0, savedEnd=endPV; + int i, k=0, savedEnd=endPV, saveFMM = forwardMostMove; *buf = NULLCHAR; if(forwardMostMove < endPV) PushInner(forwardMostMove, endPV); ParsePV(pv, FALSE, 2); // this appends PV to game, suppressing any display of it @@ -5436,7 +5436,7 @@ PvToSAN(char *pv) k += strlen(buf+k); } snprintf(buf+k, 10*MSG_SIZ-k, "%s", lastParseAttempt); // if we ran into stuff that could not be parsed, print it verbatim - if(forwardMostMove < savedEnd) PopInner(0); + if(forwardMostMove < savedEnd) { PopInner(0); forwardMostMove = saveFMM; } // PopInner would set fmm to endPV! endPV = savedEnd; return buf; }