Explorar o código

Xcode: Fix quoting of paths with square brackets

The Xcode project file format needs paths containing square
brackets ('[' or ']') to be quoted.

Issue: #20555
Brad King %!s(int64=5) %!d(string=hai) anos
pai
achega
dc0dc974a9
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Source/cmGlobalXCodeGenerator.cxx

+ 1 - 1
Source/cmGlobalXCodeGenerator.cxx

@@ -3550,7 +3550,7 @@ std::string cmGlobalXCodeGenerator::RelativeToBinary(const std::string& p)
 
 std::string cmGlobalXCodeGenerator::XCodeEscapePath(const std::string& p)
 {
-  if (p.find(' ') != std::string::npos) {
+  if (p.find_first_of(" []") != std::string::npos) {
     std::string t = cmStrCat('"', p, '"');
     return t;
   }