Fix bugs in directory-change and new-variant patches
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 6 Nov 2022 12:54:28 +0000 (13:54 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 6 Nov 2022 12:54:28 +0000 (13:54 +0100)
By too much copy-pasting SetCurrentDirectory in the WB front-end had
obtained a spurious extra argument.

winboard/winboard.c
winboard/woptions.c
winboard/wsettings.c

index e7542ad..e152a9a 100644 (file)
@@ -381,6 +381,7 @@ LoadLanguageFile(char *name)
               case 't': k = '\t'; break;\r
             }\r
             languageBuf[--i] = k;\r
+\r
         }\r
         i++;\r
     }\r
@@ -4752,7 +4753,7 @@ LoadGameDialog(HWND hwnd, char* title)
                     appData.oldSaveStyle ? "gam" : "pgn",\r
                     GAME_FILT,\r
                     title, &number, fileTitle, NULL);\r
-  SetCurrentDirectory(MSG_SIZ, dir);\r
+  SetCurrentDirectory(dir);\r
   if (f != NULL) {\r
     cmailMsgLoaded = FALSE;\r
     if (number == 0) {\r
@@ -5022,7 +5023,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                         appData.oldSaveStyle ? "pos" : "fen",\r
                         POSITION_FILT,\r
                         _("Load Position from File"), &number, fileTitle, NULL);\r
-      SetCurrentDirectory(MSG_SIZ, dir);\r
+      SetCurrentDirectory(dir);\r
       if (f != NULL) {\r
        LoadPosition(f, number, fileTitle);\r
       }\r
@@ -5047,7 +5048,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                         appData.oldSaveStyle ? "gam" : "pgn",\r
                         GAME_FILT,\r
                         _("Save Game to File"), NULL, fileTitle, NULL);\r
-      SetCurrentDirectory(MSG_SIZ, dir);\r
+      SetCurrentDirectory(dir);\r
       if (f != NULL) {\r
        SaveGame(f, 0, "");\r
       }\r
@@ -5073,7 +5074,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                         "bmp",\r
                         DIAGRAM_FILT,\r
                         _("Save Diagram to File"), NULL, fileTitle, NULL);\r
-      SetCurrentDirectory(MSG_SIZ, dir);\r
+      SetCurrentDirectory(dir);\r
       if (f != NULL) {\r
        SaveDiagram(f);\r
       }\r
@@ -5085,7 +5086,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                         "pgn",\r
                         GAME_FILT,\r
                         _("Save Game to File"), NULL, fileTitle, NULL);\r
-      SetCurrentDirectory(MSG_SIZ, dir);\r
+      SetCurrentDirectory(dir);\r
       if (f != NULL) {\r
        SaveSelected(f, 0, "");\r
       }\r
@@ -5321,6 +5322,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     case IDM_Rematch:\r
 \r
       RematchEvent();\r
+\r
       break;\r
 \r
     case IDM_CallFlag:\r
@@ -5675,6 +5677,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 \r
     case EP_BlackCannon:\r
       EditPositionMenuEvent(BlackCannon, fromX, fromY);\r
+\r
       fromX = fromY = -1;\r
       break;\r
 \r
index c7d78e6..ecdcce1 100644 (file)
@@ -905,7 +905,7 @@ VariantShowRadio(HWND hDlg)
   while((j = radioButton[i++]) != -2) {\r
        if(j == -1) continue; // no menu button\r
        v = VariantName(i-1); p = strstr(first.variants, v);\r
-       if(p && p != &first.variants && p[-1] != ',') p == NULL;\r
+       if(p && p != first.variants && p[-1] != ',') p = NULL;\r
        if(appData.noChessProgram || p && (!*v || strlen(v) == strlen(p) || p[strlen(v)] == ',')) {\r
           SendMessage(combo, CB_ADDSTRING, 0, (LPARAM) T_(v));\r
            if(gameInfo.variant == i - 1) current = nr;\r
@@ -1218,6 +1218,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   COLORREF *colorref;\r
 \r
   switch (message) {\r
+\r
   case WM_INITDIALOG: /* message: initialize dialog box */\r
 \r
     mca = colorizeAttribs;\r
index e5fdbfc..bde55b4 100644 (file)
@@ -528,7 +528,7 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
                                                       GetSaveFileName( &ofn ) ) {\r
                              SetDlgItemText( hDlg, i+3, buf );\r
                          }\r
-                         SetCurrentDirectory(MSG_SIZ, dir);\r
+                         SetCurrentDirectory(dir);\r
                } else\r
                if(j == -3) {\r
                    GetDlgItemText( hDlg, i+3, buf, MSG_SIZ );\r