Fixed srvany-compatible environment checkbox.
authorIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 12:02:06 +0000 (12:02 +0000)
committerIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 14:32:20 +0000 (14:32 +0000)
The checkbox was inverted.  If we were replacing the environment, like
srvany does, it was unchecked, suggesting that the environment would be
appended.

gui.cpp

diff --git a/gui.cpp b/gui.cpp
index 85a7256..d704304 100644 (file)
--- a/gui.cpp
+++ b/gui.cpp
@@ -136,13 +136,13 @@ int nssm_gui(int resource, nssm_service_t *service) {
     TCHAR *env;\r
     unsigned long envlen;\r
     if (service->env_extralen) {\r
-      SendDlgItemMessage(tablist[NSSM_TAB_ENVIRONMENT], IDC_ENVIRONMENT_REPLACE, BM_SETCHECK, BST_CHECKED, 0);\r
       env = service->env_extra;\r
       envlen = service->env_extralen;\r
     }\r
     else {\r
       env = service->env;\r
       envlen = service->envlen;\r
+      if (envlen) SendDlgItemMessage(tablist[NSSM_TAB_ENVIRONMENT], IDC_ENVIRONMENT_REPLACE, BM_SETCHECK, BST_CHECKED, 0);\r
     }\r
 \r
     if (envlen) {\r