diff --git a/package.json b/package.json index 55d9b79..73a42c8 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,10 @@ "version": "1.0.2", "license": "MIT", "dependencies": { - "temp": "~0.5.1" + "temp": "~0.8.1" }, "devDependencies": { - "chai": "~1.5.0", + "chai": "~1.10.0", "mocha": "~1.9.0" }, "optionalDependencies": {}, diff --git a/src/shell.cpp b/src/shell.cpp index e12fe31..5707126 100644 --- a/src/shell.cpp +++ b/src/shell.cpp @@ -1,5 +1,6 @@ #include #include +#include #ifdef _WIN32 @@ -31,9 +32,12 @@ int exec(const char* command) { si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); + int command_len = strlen(command); + std::vector command_copy(&command[0], &command[command_len]); + // Start the child process. if(!CreateProcess(NULL, // No module name (use command line) - (LPSTR) command,// Command line + (LPSTR) &command_copy[0],// Command line NULL, // Process handle not inheritable NULL, // Thread handle not inheritable FALSE, // Set handle inheritance to FALSE