[lld] r193424 - [PECOFF] Fix doublequote escaping.

Rui Ueyama ruiu at google.com
Fri Oct 25 11:12:52 PDT 2013


Author: ruiu
Date: Fri Oct 25 13:12:51 2013
New Revision: 193424

URL: http://llvm.org/viewvc/llvm-project?rev=193424&view=rev
Log:
[PECOFF] Fix doublequote escaping.

Modified:
    lld/trunk/lib/Driver/WinLinkDriver.cpp

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=193424&r1=193423&r2=193424&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Fri Oct 25 13:12:51 2013
@@ -246,8 +246,8 @@ std::string createManifestXml(PECOFFLink
   return std::move(ret);
 }
 
-// Quote double quotes and backslashes in the given string, so that we can embed
-// the string into a resource script file.
+// Convert one doublequote to two doublequotes, so that we can embed the string
+// into a resource script file.
 std::string quoteXml(StringRef str) {
   std::string ret;
   ret.reserve(str.size() * 2);
@@ -263,8 +263,7 @@ std::string quoteXml(StringRef str) {
     for (int i = 0, size = line.size(); i < size; ++i) {
       switch (p[i]) {
       case '\"':
-      case '\\':
-        ret.append("\\");
+        ret.append("\"");
         // fallthrough
       default:
         ret.append(1, p[i]);





More information about the llvm-commits mailing list