Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/shell.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <node.h>
#include <string>
#include <vector>

#ifdef _WIN32

Expand Down Expand Up @@ -30,10 +31,13 @@ int exec(const char* command) {
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));


int command_len = strlen(command);
std::vector<char> 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
Expand Down