summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorLuca Cappa <lucappa@microsoft.com>2019-03-05 19:08:09 (GMT)
committerBrad King <brad.king@kitware.com>2019-03-06 14:37:21 (GMT)
commit0bf4418017d7d6f653a8e3192a8f628a35587a04 (patch)
treec9f306f04b5c2b664ed19d57434be0596607ad3a /Source/cmVisualStudio10TargetGenerator.cxx
parent20a41aa589d4418f9ac46fc8c0402162d1d82873 (diff)
downloadCMake-0bf4418017d7d6f653a8e3192a8f628a35587a04.zip
CMake-0bf4418017d7d6f653a8e3192a8f628a35587a04.tar.gz
CMake-0bf4418017d7d6f653a8e3192a8f628a35587a04.tar.bz2
VS: Encode newlines in XML attributes
Encode `\n` as `&#10;` to avoid generating a literal newline inside an XML attribute. This is more readable and also fixes custom commands in `.csproj` files with VS 2019 RC. Fixes: #19001
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 8e08417..7736e59 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -35,6 +35,7 @@ static std::string cmVS10EscapeAttr(std::string arg)
cmSystemTools::ReplaceString(arg, "<", "&lt;");
cmSystemTools::ReplaceString(arg, ">", "&gt;");
cmSystemTools::ReplaceString(arg, "\"", "&quot;");
+ cmSystemTools::ReplaceString(arg, "\n", "&#10;");
return arg;
}