Fix Game List highlighting (WB)
authorH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 2 Dec 2016 08:25:13 +0000 (09:25 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Jan 2017 15:39:24 +0000 (16:39 +0100)
The binary search for finding the current game amongst the listed ones
in the Game List was not looking in the first 32 displayed entries.

winboard/wgamelist.c

index 19917e6..a3c96be 100644 (file)
@@ -439,7 +439,7 @@ VOID GameListHighlight(int index)
         res = SendDlgItemMessage( gameListDialog, OPT_GameListText, LB_GETTEXT, i, (LPARAM)buf );\r
         if(res == LB_ERR || index < atoi( buf )) break;\r
   }\r
-  j = i/2;\r
+  j = (i == 64 ? 0 : i/2);\r
   while(i-j > 1) {\r
         n = (i + j) >> 1;\r
         res = SendDlgItemMessage( gameListDialog, OPT_GameListText, LB_GETTEXT, n, (LPARAM)buf );\r