CLI: fix execute command, quote argument that contains spaces
This commit is contained in:
parent
d23fd26ce0
commit
dc6f0740c1
|
@ -1176,7 +1176,10 @@ bool CppCheckExecutor::executeCommand(std::string exe, std::vector<std::string>
|
|||
for (const std::string &arg : args) {
|
||||
if (!joinedArgs.empty())
|
||||
joinedArgs += " ";
|
||||
joinedArgs += arg;
|
||||
if (arg.find(" ") != std::string::npos)
|
||||
joinedArgs += '"' + arg + '"';
|
||||
else
|
||||
joinedArgs += arg;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
Loading…
Reference in New Issue