fix(windows): accept ordinary drive path separators (#791)

This commit is contained in:
N0zoM1z0
2026-10-07 03:51:59 +08:00
committed by GitHub
parent d2aed172ab
commit b62931f833
8 changed files with 94 additions and 10 deletions
+1
View File
@@ -14,6 +14,7 @@ static std::wstring hex(const unsigned char* bytes, size_t count) {
}
static std::wstring localPath(std::wstring path) {
path = ordinaryDriveSeparators(std::move(path));
if (path.rfind(L"\\\\?\\", 0) == 0) path.erase(0, 4);
require(path.size() >= 3 && path[1] == L':' && path[2] == L'\\' &&
((path[0] >= L'A' && path[0] <= L'Z') || (path[0] >= L'a' && path[0] <= L'z')),