summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-10-25 18:12:51 +0000
committerRui Ueyama <ruiu@google.com>2013-10-25 18:12:51 +0000
commitd334b1a326a94489cbe2c37ac7adb4457437ad66 (patch)
tree660380eccd779902c7f1606c16731d163b6c5955
parent0d2cbc0bd87f16e47a11a3b923f41b0bf1fd1c86 (diff)
downloadbcm5719-llvm-d334b1a326a94489cbe2c37ac7adb4457437ad66.tar.gz
bcm5719-llvm-d334b1a326a94489cbe2c37ac7adb4457437ad66.zip
[PECOFF] Fix doublequote escaping.
llvm-svn: 193424
-rw-r--r--lld/lib/Driver/WinLinkDriver.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lld/lib/Driver/WinLinkDriver.cpp b/lld/lib/Driver/WinLinkDriver.cpp
index 35e7eefca47..8ba63974f0a 100644
--- a/lld/lib/Driver/WinLinkDriver.cpp
+++ b/lld/lib/Driver/WinLinkDriver.cpp
@@ -246,8 +246,8 @@ std::string createManifestXml(PECOFFLinkingContext &ctx) {
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]);
OpenPOWER on IntegriCloud