Skip to content

Commit

Permalink
Arch: normalize the long path to satisfy Win32 long path requirements…
Browse files Browse the repository at this point in the history
… (e.g. no dotdot and dot)
  • Loading branch information
Simon Haegler authored and mistafunk committed Aug 5, 2024
1 parent c949420 commit dfe27db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pxr/base/arch/fileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ std::wstring _ArchHandleLongWindowsPaths(const std::wstring& path)
// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createdirectoryw
// ARCH_PATH_MAX counts the null terminator as well
if (path.size() >= ARCH_PATH_MAX - 12 - 1) {
std::wstring longPath = path;
// the \\?\ prefix requires removal of any dotdot and dot, need to normalize
std::wstring longPath = _NormPath(path);

// the \\?\ prefix requires strict backslash separators:
// see https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
Expand Down

0 comments on commit dfe27db

Please sign in to comment.