|
|
@ -163,10 +163,11 @@ struct Command {
|
|
|
|
|
|
|
|
|
|
|
|
static std::string quote(const std::string &str) {
|
|
|
|
static std::string quote(const std::string &str) {
|
|
|
|
// Don't quote arguments that don't need quoting
|
|
|
|
// Don't quote arguments that don't need quoting
|
|
|
|
if (str.find(' ') == std::string::npos && str.find('\"') == std::string::npos && str.find('/') == std::string::npos &&
|
|
|
|
// https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#unquoted-argument
|
|
|
|
str.find(';') == std::string::npos) {
|
|
|
|
// NOTE: Normally '/' does not require quoting according to the documentation but this has been the case here
|
|
|
|
|
|
|
|
// previously, so for backwards compatibility its still here.
|
|
|
|
|
|
|
|
if (str.find_first_of("()#\"\\'> |/") == str.npos)
|
|
|
|
return str;
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string result;
|
|
|
|
std::string result;
|
|
|
|
result += "\"";
|
|
|
|
result += "\"";
|
|
|
|
for (char ch : str) {
|
|
|
|
for (char ch : str) {
|
|
|
|