Fix saving of engine list
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 18 Jun 2019 14:27:31 +0000 (16:27 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 18 Jun 2019 14:27:31 +0000 (16:27 +0200)
When a separate engine listw as specified it was only saved after altering
engine settings. Not after Edit Engine List or on exit. Now it is saved
after editing, but not on exit. The latter should cause less loss of data
when multiple instances of WinBoard are open.

backend.c
dialogs.c
winboard/wedittags.c

index f43d1e9..fe7ad95 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -11498,7 +11498,7 @@ SaveEngineSettings (int n)
     s = malloc(len);
     snprintf(s, len, "%s%s%s", firstChessProgramNames, currentEngine[n], q);
     FREE(firstChessProgramNames); firstChessProgramNames = s; // new list
-    if(*engineListFile) SaveEngineList();
+    SaveEngineList();
 }
 
 // following implemented as macro to avoid type limitations
index 1372cfa..84b63fc 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -1246,9 +1246,7 @@ static void
 changeTags (int n)
 {
     GenericReadout(tagsOptions, 1);
-    if(bookUp) SaveToBook(tagsText), DisplayBook(currentMove); else
-    if(resPtr) { ASSIGN(*resPtr, tagsText); } else
-    ReplaceTags(tagsText, &gameInfo);
+    NewTagsCallback(0);
 }
 
 void
index 63080c9..68fb54a 100644 (file)
@@ -137,7 +137,7 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
            *p++ = *q++;\r
        }\r
        *p = NULLCHAR; err = 0;\r
-        if(resPtr) *resPtr = strdup(str); else\r
+        if(resPtr) { *resPtr = strdup(str); if(resPtr == &firstChessProgramNames) SaveEngineList(); } else\r
        if(bookUp) SaveToBook(str), DisplayBook(currentMove); else\r
        err = ReplaceTags(str, &gameInfo);\r
        if (err) DisplayError(_("Error replacing tags."), err);\r