Correctly handle the case where the application executable is under
a path which contains space and an executable sharing the initial
part of that path (up to a space) exists.
A (contrived) example is when Application is
C:\stuff\app lications\foo.exe
and C:\stuff\app.exe also exists.
Thanks Eugene Lifshitz.
+Changes since 2.9
+-----------------
+ * Fixed edge case with CreateProcess().
+
+ Correctly handle the case where the application executable is under
+ a path which contains space and an executable sharing the initial
+ part of that path (up to a space) exists.
+
Changes since 2.8
-----------------
* Fixed failure to run on Windows versions prior to Vista.
application could be left running on service shutdown, and that a missing\r
registry value for AppDirectory confused NSSM.\r
Thanks to Peter Wagemans and Laszlo Keresztfalvi for suggesting throttling restarts.\r
+Thanks to Eugene Lifshitz for finding an edge case in CreateProcess().\r
\r
Licence\r
-------\r
\r
/* Launch executable with arguments */\r
char cmd[CMD_LENGTH];\r
- if (_snprintf(cmd, sizeof(cmd), "%s %s", exe, flags) < 0) {\r
+ if (_snprintf(cmd, sizeof(cmd), "\"%s\" %s", exe, flags) < 0) {\r
log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OUT_OF_MEMORY, "command line", "start_service", 0);\r
return stop_service(2, true, true);\r
}\r