Skip to content

Commit

Permalink
Handle paths longer than MAX_PATH on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Feb 3, 2022
1 parent 85e03da commit e5cfc0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/process_wrapper/system_windows.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ System::StrType System::GetWorkingDirectory() {
if (::GetCurrentDirectory(kMaxBufferLength, buffer) == 0) {
return System::StrType{};
}
return System::StrType{buffer};
// Account for MAX_PATH limitations
// https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
return System::StrType{"\\\\?\\"} + System::StrType{buffer};
}

int System::Exec(const System::StrType& executable,
Expand Down

0 comments on commit e5cfc0d

Please sign in to comment.