Extended path prefix handling on Windows.

This commit is contained in:
Steffen Schümann 2020-10-09 23:57:54 +02:00
parent ff6e5e8959
commit 6649653be9

View File

@ -1654,6 +1654,7 @@ GHC_INLINE void path::postprocess_path_with_format(path::impl_string_type& p, pa
#ifdef GHC_OS_WINDOWS
case path::auto_format:
case path::native_format:
if (p.length() > 4 && p[2] == '?') {
if (detail::startsWith(p, std::string("\\\\?\\"))) {
// remove Windows long filename marker
p.erase(0, 4);
@ -1662,6 +1663,10 @@ GHC_INLINE void path::postprocess_path_with_format(path::impl_string_type& p, pa
p[0] = '\\';
}
}
else if (detail::startsWith(p, std::string("\\??\\"))) {
p.erase(0, 4);
}
}
for (auto& c : p) {
if (c == '\\') {
c = '/';