From: H.G. Muller Date: Thu, 25 Nov 2010 18:31:52 +0000 (+0100) Subject: Fix spurious scores in comments X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=19ca22353227f3cd38e0e3926cd5cfbfbbb4ddd6;p=xboard.git 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. --- 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--;