[dsymutil] Escape CFBundleIdentifier in plist.
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 26 May 2020 16:37:14 +0000 (09:37 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Tue, 26 May 2020 16:38:32 +0000 (09:38 -0700)
Revision 333565 started escaping HTML special characters in the plist
written by dsymutil, but didn't include the updated CFBundleIdentifier.

llvm/test/tools/dsymutil/Inputs/Info.plist
llvm/test/tools/dsymutil/X86/darwin-bundle.test
llvm/tools/dsymutil/dsymutil.cpp

index 97c0ae2..e330c95 100644 (file)
@@ -5,7 +5,7 @@
                <key>CFBundleDevelopmentRegion</key>
                <string>English</string>
                <key>CFBundleIdentifier</key>
-               <string>custom</string>
+               <string>Foo&amp;Bar</string>
                <key>CFBundleInfoDictionaryVersion</key>
                <string>6.0</string>
                <key>CFBundlePackageType</key>
index 7f1224f..d44b25e 100644 (file)
@@ -18,7 +18,7 @@ CHECK-NEXT:         <dict>
 CHECK-NEXT:                 <key>CFBundleDevelopmentRegion</key>
 CHECK-NEXT:                 <string>English</string>
 CHECK-NEXT:                 <key>CFBundleIdentifier</key>
-CHECK-NEXT:                 <string>com.apple.xcode.dsym.custom</string>
+CHECK-NEXT:                 <string>com.apple.xcode.dsym.Foo&amp;Bar</string>
 CHECK-NEXT:                 <key>CFBundleInfoDictionaryVersion</key>
 CHECK-NEXT:                 <string>6.0</string>
 CHECK-NEXT:                 <key>CFBundlePackageType</key>
index 32df556..3a32acb 100644 (file)
@@ -338,7 +338,9 @@ static Error createPlistFile(StringRef Bin, StringRef BundleRoot,
      << "\t\t<key>CFBundleDevelopmentRegion</key>\n"
      << "\t\t<string>English</string>\n"
      << "\t\t<key>CFBundleIdentifier</key>\n"
-     << "\t\t<string>com.apple.xcode.dsym." << BI.IDStr << "</string>\n"
+     << "\t\t<string>com.apple.xcode.dsym.";
+  printHTMLEscaped(BI.IDStr, PL);
+  PL << "</string>\n"
      << "\t\t<key>CFBundleInfoDictionaryVersion</key>\n"
      << "\t\t<string>6.0</string>\n"
      << "\t\t<key>CFBundlePackageType</key>\n"