From 2e25ba964f3e2faf1a328b3de269367c3bba8c58 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 23 Oct 2011 15:53:32 +0200 Subject: [PATCH] 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. --- backend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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; } -- 1.7.0.4