summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 60e61594305a..0ed323c3af5e 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -194,18 +194,15 @@ int startprocess(string command, string args) {
command=command.substr(0,pos+strlen("ccache"))+".exe";
}
- if (args[0] != ' ')
- {
- args.insert(0, " "); // lpCommandLine *must* start with space!
- }
+ auto cmdline = "\"" + command + "\" " + args;
//cerr << "CMD= " << command << " " << args << endl;
// Commandline may be modified by CreateProcess
- char* cmdline=_strdup(args.c_str());
+ char* cmdlineBuf=_strdup(cmdline.c_str());
- if(!CreateProcess(command.c_str(), // Process Name
- cmdline, // Command Line
+ if(!CreateProcess(nullptr, // Process Name
+ cmdlineBuf, // Command Line
NULL, // Process Handle not Inheritable
NULL, // Thread Handle not Inheritable
TRUE, // Handles are Inherited