From 19ca22353227f3cd38e0e3926cd5cfbfbbb4ddd6 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 25 Nov 2010 19:31:52 +0100 Subject: [PATCH] Fix spurious scores in comments The comment popup is also used to display engine PV info, but when the contents of the window is written back when we select a variation, it was treated as a real comment. This is fixed now by checing in ReplaceComment() if the comment starts with the PV info, and if so, ignore the latter. This solves the problem, but I guess the real bug is that selecting a variation tries to write the comment even if it did not change. --- backend.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index 4c9390e..b962510 100644 --- a/backend.c +++ b/backend.c @@ -13287,7 +13287,13 @@ ReplaceComment(index, text) char *text; { int len; + char *p; + float score; + if(index && sscanf(text, "%f/%d", &score, &len) == 2 && + pvInfoList[index-1].depth == len && + pvInfoList[index-1].score == (int) (score*100 + 0.5) && + (p = strchr(text, '\n'))) text = p; // [HGM] strip off first line with PV info, if any while (*text == '\n') text++; len = strlen(text); while (len > 0 && text[len - 1] == '\n') len--; -- 1.7.0.4