mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Extended path prefix handling on Windows.
This commit is contained in:
parent
ff6e5e8959
commit
6649653be9
@ -1654,12 +1654,17 @@ GHC_INLINE void path::postprocess_path_with_format(path::impl_string_type& p, pa
|
|||||||
#ifdef GHC_OS_WINDOWS
|
#ifdef GHC_OS_WINDOWS
|
||||||
case path::auto_format:
|
case path::auto_format:
|
||||||
case path::native_format:
|
case path::native_format:
|
||||||
if (detail::startsWith(p, std::string("\\\\?\\"))) {
|
if (p.length() > 4 && p[2] == '?') {
|
||||||
// remove Windows long filename marker
|
if (detail::startsWith(p, std::string("\\\\?\\"))) {
|
||||||
p.erase(0, 4);
|
// remove Windows long filename marker
|
||||||
if (detail::startsWith(p, std::string("UNC\\"))) {
|
p.erase(0, 4);
|
||||||
p.erase(0, 2);
|
if (detail::startsWith(p, std::string("UNC\\"))) {
|
||||||
p[0] = '\\';
|
p.erase(0, 2);
|
||||||
|
p[0] = '\\';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (detail::startsWith(p, std::string("\\??\\"))) {
|
||||||
|
p.erase(0, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto& c : p) {
|
for (auto& c : p) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user