Helper function to determine the parent directory of a path.
#include "nssm.h"\r
\r
+static void strip_basename(char *buffer) {\r
+ size_t len = strlen(buffer);\r
+ size_t i;\r
+ for (i = len; i && buffer[i] != '\\' && buffer[i] != '/'; i--);\r
+ /* X:\ is OK. */\r
+ if (i && buffer[i-1] == ':') i++;\r
+ buffer[i] = '\0';\r
+}\r
+\r
int nssm_gui(int resource, char *name) {\r
/* Create window */\r
HWND dlg = CreateDialog(0, MAKEINTRESOURCE(resource), 0, install_dlg);\r