Skip to content

Commit eca352f

Browse files
committed
fix more path normalization bugs
1 parent 8e3c791 commit eca352f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/importproject.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,6 +1974,9 @@ void ImportProject::addProperty(const tinyxml2::XMLElement *node, PropertiesMap
19741974
return;
19751975
const char *eText = node->GetText();
19761976
std::string text(eText ? eText : "");
1977+
// Normalize native path separators before expansion so property values are
1978+
// stored with '/' and debug messages show normalized paths.
1979+
text = Path::fromNativeSeparators(std::move(text));
19771980
const std::string original = properties[eName];
19781981
findAndReplace(text, "$(" + std::string(eName) + ")", original);
19791982
expandMSBuildVariables(text, properties);
@@ -1987,6 +1990,7 @@ void ImportProject::addMetadata(const tinyxml2::XMLElement *node, PropertiesMap
19871990
return;
19881991
const char *eText = node->GetText();
19891992
std::string text(eText ? eText : "");
1993+
text = Path::fromNativeSeparators(std::move(text));
19901994
const std::string original = metadata[eName];
19911995
findAndReplace(text, "%(" + std::string(eName) + ")", original);
19921996
std::string::size_type pos = 0;
@@ -2010,7 +2014,7 @@ std::string ImportProject::getMetadata(const tinyxml2::XMLElement *node, Propert
20102014
const char *eText = node->GetText();
20112015
if (!eName || !eText || !conditionIsTrue(node, properties))
20122016
return original;
2013-
std::string text(eText);
2017+
std::string text(Path::fromNativeSeparators(eText));
20142018
findAndReplace(text, "%(" + std::string(eName) + ")", original);
20152019
{
20162020
std::string::size_type pos = 0;

0 commit comments

Comments
 (0)