diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 0ef771f81..eb7864712 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -431,7 +431,8 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories( { emittedDirs.insert(dir); fout << "\n"; } } @@ -875,8 +876,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 +929,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) @@ -999,15 +1002,17 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout, const std::string& path, const char* prefix) { + std::string targetXml = cmExtraEclipseCDT4Generator::EscapeForXML(target); + std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path); fout << - "\n" "" << cmExtraEclipseCDT4Generator::GetEclipsePath(make) << "\n" "" << makeArgs << "\n" - "" << target << "\n" + "" << targetXml << "\n" "true\n" "false\n" "\n"