From: Iain Patterson Date: Fri, 10 Jan 2014 23:27:54 +0000 (+0000) Subject: Write canonical AppExit string. X-Git-Tag: v2.22~69 X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=b197ffd8aebfd6597466f2f537f0a13d1013263a;hp=bf6fbeb0064d2e33f57ae30a1a37a01b46d37e6c;p=nssm.git Write canonical AppExit string. If the user ran "nssm set AppExit Default exit" the default value of AppExit would be set verbatim to "exit" which is in contrast the documented value "Exit" with normal capitalisation. There's no harm to that fact, as AppExit is retrieved case-insensitively but it was nonetheless not working as intended. --- diff --git a/settings.cpp b/settings.cpp index 707e6c1..3943220 100644 --- a/settings.cpp +++ b/settings.cpp @@ -148,7 +148,7 @@ static int setting_set_exit_action(const TCHAR *service_name, void *param, const for (int i = 0; exit_action_strings[i]; i++) { if (! _tcsnicmp((const TCHAR *) action_string, exit_action_strings[i], ACTION_LEN)) { if (default_value && str_equiv(action_string, (TCHAR *) default_value)) ret = 0; - if (RegSetValueEx(key, code, 0, REG_SZ, (const unsigned char *) action_string, (unsigned long) (_tcslen(action_string) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS) { + if (RegSetValueEx(key, code, 0, REG_SZ, (const unsigned char *) exit_action_strings[i], (unsigned long) (_tcslen(action_string) + 1) * sizeof(TCHAR)) != ERROR_SUCCESS) { print_message(stderr, NSSM_MESSAGE_SETVALUE_FAILED, code, service_name, error_string(GetLastError())); RegCloseKey(key); return -1;