From cb94587a88866f3278676ea011c78e1c9d3663ec Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 12 Feb 2011 21:49:08 +0100 Subject: [PATCH] Fix XML escaping for the project() name in Eclipse projects (#11658) Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0ef771f81..4cd052afd 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -875,8 +875,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const fout << "\n" "\n" "\n" - "GetProjectName() << ".null.1\"" - " name=\"" << mf->GetProjectName() << "\"/>\n" + "EscapeForXML(mf->GetProjectName()) + << ".null.1\" name=\"" << this->EscapeForXML(mf->GetProjectName()) + << "\"/>\n" "\n" "\n" ; @@ -927,7 +928,8 @@ cmExtraEclipseCDT4Generator::GenerateProjectName(const std::string& name, const std::string& type, const std::string& path) { - return name + (type.empty() ? "" : "-") + type + "@" + path; + return cmExtraEclipseCDT4Generator::EscapeForXML(name) + +(type.empty() ? "" : "-") + type + "@" + path; } std::string cmExtraEclipseCDT4Generator::EscapeForXML(const std::string& value)