Skip to content

Commit

Permalink
Support paths with "\\?\" prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
DDoSolitary committed Jun 26, 2020
1 parent 80eaca4 commit c319460
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ std::unique_ptr<file_path> linux_path::clone() const {
wsl_path::wsl_path(crwstr base) : file_path(normalize_path(base)) {}

wstr wsl_path::normalize_path(crwstr path) {
auto o = L"\\\\?\\" + get_full_path(path);
const auto prefix = L"\\\\?\\";
const auto prefix_len = wcslen(prefix);
auto o = get_full_path(path);
if (o.compare(0, prefix_len, prefix) != 0) {
o = L"\\\\?\\" + get_full_path(path);
}
if (o.back() != L'\\') o += L'\\';
return o;
}
Expand Down

0 comments on commit c319460

Please sign in to comment.