mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-16 07:28:23 -05:00
KWSys 2024-11-01 (1cfc8445)
Code extracted from:
https://gitlab.kitware.com/utils/kwsys.git
at commit 1cfc8445570dc46883e84301eb6c31ebc5867826 (master).
Upstream Shortlog
-----------------
Brad King (1):
fdf4f2f8 SystemTools: Fix ReadSymlink for links to absolute paths on Windows
This commit is contained in:
committed by
Brad King
parent
875cf5f61f
commit
f09390fbf1
@@ -3392,6 +3392,14 @@ Status SystemTools::ReadSymlink(std::string const& newName,
|
|||||||
}
|
}
|
||||||
std::wstring substituteName(substituteNameData, substituteNameLength);
|
std::wstring substituteName(substituteNameData, substituteNameLength);
|
||||||
origName = Encoding::ToNarrow(substituteName);
|
origName = Encoding::ToNarrow(substituteName);
|
||||||
|
// Symbolic links to absolute paths may use a NT Object Path prefix.
|
||||||
|
// If the path begins with "\??\UNC\", replace it with "\\".
|
||||||
|
// Otherwise, if the path begins with "\??\", remove the prefix.
|
||||||
|
if (origName.compare(0, 8, "\\??\\UNC\\") == 0) {
|
||||||
|
origName.erase(1, 6);
|
||||||
|
} else if (origName.compare(0, 4, "\\??\\") == 0) {
|
||||||
|
origName.erase(0, 4);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
char buf[KWSYS_SYSTEMTOOLS_MAXPATH + 1];
|
char buf[KWSYS_SYSTEMTOOLS_MAXPATH + 1];
|
||||||
int count = static_cast<int>(
|
int count = static_cast<int>(
|
||||||
|
|||||||
Reference in New Issue
Block a user