Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/native/corehost/hostmisc/pal.windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -884,8 +884,12 @@ bool pal::realpath(pal::string_t* path, bool skip_error_logging)
}
}

// Remove the \\?\ prefix, unless it is necessary or was already there
if (LongFile::IsExtended(str) && !LongFile::IsExtended(*path) &&
// Remove the UNC extended prefix (\\?\UNC\) or extended prefix (\\?\) unless it is necessary or was already there
if (LongFile::IsUNCExtended(str) && !LongFile::IsUNCExtended(*path) && str.length() < MAX_PATH)
{
str.replace(0, LongFile::UNCExtendedPathPrefix.size(), LongFile::UNCPathPrefix);
}
else if (LongFile::IsExtended(str) && !LongFile::IsExtended(*path) &&
!LongFile::ShouldNormalize(str.substr(LongFile::ExtendedPrefix.size())))
{
str.erase(0, LongFile::ExtendedPrefix.size());
Expand Down
Loading