Hung-Te Lin spotted that the `multi-changesettings-crash' workaround for Windows
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Mon, 21 Mar 2005 22:20:22 +0000 (22:20 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Mon, 21 Mar 2005 22:20:22 +0000 (22:20 +0000)
would prevent a user opening Change Settings if they'd cancelled a previous
Change Settings.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5539 cda61777-01e9-0310-a592-d414129be87e

windows/window.c

index fedcc35..e6c0e39 100644 (file)
@@ -108,7 +108,7 @@ static void *backhandle;
 
 static struct unicode_data ucsdata;
 static int session_closed;
-static int reconfiguring;
+static int reconfiguring = FALSE;
 
 static const struct telnet_special *specials;
 static int n_specials;
@@ -1968,16 +1968,20 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
            {
                Config prev_cfg;
                int init_lvl = 1;
+               int reconfig_result;
 
                if (reconfiguring)
-                 break;
+                   break;
                else
-                 reconfiguring = TRUE;
+                   reconfiguring = TRUE;
 
                GetWindowText(hwnd, cfg.wintitle, sizeof(cfg.wintitle));
                prev_cfg = cfg;
 
-               if (!do_reconfig(hwnd, back ? back->cfg_info(backhandle) : 0))
+               reconfig_result =
+                   !do_reconfig(hwnd, back ? back->cfg_info(backhandle) : 0);
+               reconfiguring = FALSE;
+               if (!reconfig_result)
                    break;
 
                {
@@ -2110,7 +2114,6 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
                InvalidateRect(hwnd, NULL, TRUE);
                reset_window(init_lvl);
                net_pending_errors();
-               reconfiguring = FALSE;
            }
            break;
          case IDM_COPYALL: