Fixed warning when file disposition isn't set.
authorIain Patterson <me@iain.cx>
Wed, 22 Jan 2014 22:21:09 +0000 (22:21 +0000)
committerIain Patterson <me@iain.cx>
Wed, 22 Jan 2014 22:22:48 +0000 (22:22 +0000)
If AppStdoutDisposition and AppStderrDisposition are both missing from
the registry, the service editing GUI would incorrectly complain that
the current configuration couldn't be represented in the interface.

gui.cpp

diff --git a/gui.cpp b/gui.cpp
index 2c20286..694e0e2 100644 (file)
--- a/gui.cpp
+++ b/gui.cpp
@@ -161,7 +161,7 @@ int nssm_gui(int resource, nssm_service_t *service) {
     if (! service->rotate_bytes_high) SetDlgItemInt(tablist[NSSM_TAB_ROTATION], IDC_ROTATE_BYTES_LOW, service->rotate_bytes_low, 0);\r
 \r
     /* Check if advanced settings are in use. */\r
-    if (service->stdout_disposition ^ service->stderr_disposition || service->stdout_disposition & ~CREATE_ALWAYS || service->stderr_disposition & ~CREATE_ALWAYS) popup_message(dlg, MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_STDIO);\r
+    if (service->stdout_disposition != service->stderr_disposition || (service->stdout_disposition != NSSM_STDOUT_DISPOSITION && service->stdout_disposition != CREATE_ALWAYS) || (service->stderr_disposition != NSSM_STDERR_DISPOSITION && service->stderr_disposition != CREATE_ALWAYS)) popup_message(dlg, MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_STDIO);\r
     if (service->rotate_bytes_high) popup_message(dlg, MB_OK | MB_ICONWARNING, NSSM_GUI_WARN_ROTATE_BYTES);\r
 \r
     /* Environment tab. */\r