diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..df5f35d --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/src/path.cpp b/src/path.cpp index 2035949..d0f4217 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -128,7 +128,12 @@ std::unique_ptr 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; }