File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,11 @@ struct Command {
163163
164164 static std::string quote (const std::string &str) {
165165 // Don't quote arguments that don't need quoting
166- if (str.find (' ' ) == std::string::npos && str.find (' \" ' ) == std::string::npos && str.find (' /' ) == std::string::npos &&
167- str.find (' ;' ) == std::string::npos) {
166+ // https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#unquoted-argument
167+ // NOTE: Normally '/' does not require quoting according to the documentation but this has been the case here
168+ // previously, so for backwards compatibility its still here.
169+ if (str.find_first_of (" ()#\"\\ '> |/" ) == str.npos )
168170 return str;
169- }
170171 std::string result;
171172 result += " \" " ;
172173 for (char ch : str) {
You can’t perform that action at this time.
0 commit comments