summaryrefslogtreecommitdiff
path: root/Source/cmXCodeObject.cxx
diff options
context:
space:
mode:
authorGregor Jasny <gjasny@googlemail.com>2015-12-27 16:33:46 +0100
committerBrad King <brad.king@kitware.com>2016-01-07 13:23:24 -0500
commitba39d7e9d04b6a8d3d9bccdf07b69cd2d959a083 (patch)
treea4619cbf9b622f0dc95145913c605ae94f2f47a7 /Source/cmXCodeObject.cxx
parent90b50b2e28d32bcf239d3f6bc4d1114756a78827 (diff)
downloadcmake-ba39d7e9d04b6a8d3d9bccdf07b69cd2d959a083.tar.gz
Xcode: Escape all backslashes in strings (#15328)
Before this change backslashes in strings were escaped during compile flags adds via AppendFlag(). But global flags like OTHER_CPLUSPLUSFLAGS are not added as flags but as plain strings so they were not escaped properly. Now the escaping is performed within cmXCodeObject::PrintString() which ensures that strings are always encoded.
Diffstat (limited to 'Source/cmXCodeObject.cxx')
-rw-r--r--Source/cmXCodeObject.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index c59c3609ff..5bc34c136c 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -255,9 +255,9 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String)
for(std::string::const_iterator i = String.begin();
i != String.end(); ++i)
{
- if(*i == '"')
+ if(*i == '"' || *i == '\\')
{
- // Escape double-quotes.
+ // Escape double-quotes and backslashes.
os << '\\';
}
os << *i;