From: Iain Patterson Date: Wed, 1 Jan 2014 12:02:06 +0000 (+0000) Subject: Fixed srvany-compatible environment checkbox. X-Git-Tag: v2.22~95 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=2e2d1245db50b3244ba8f2b539f0e7d298c0b8b7;p=nssm.git Fixed srvany-compatible environment checkbox. The checkbox was inverted. If we were replacing the environment, like srvany does, it was unchecked, suggesting that the environment would be appended. --- diff --git a/gui.cpp b/gui.cpp index 85a7256..d704304 100644 --- a/gui.cpp +++ b/gui.cpp @@ -136,13 +136,13 @@ int nssm_gui(int resource, nssm_service_t *service) { TCHAR *env; unsigned long envlen; if (service->env_extralen) { - SendDlgItemMessage(tablist[NSSM_TAB_ENVIRONMENT], IDC_ENVIRONMENT_REPLACE, BM_SETCHECK, BST_CHECKED, 0); env = service->env_extra; envlen = service->env_extralen; } else { env = service->env; envlen = service->envlen; + if (envlen) SendDlgItemMessage(tablist[NSSM_TAB_ENVIRONMENT], IDC_ENVIRONMENT_REPLACE, BM_SETCHECK, BST_CHECKED, 0); } if (envlen) {