fix: Pattern auto-loading issue on Windows (#808)
This commit is contained in:
parent
bececff9e5
commit
c35eaa7a4d
@ -266,12 +266,13 @@ namespace hex::fs {
|
|||||||
|
|
||||||
std::fs::path toShortPath(const std::fs::path &path) {
|
std::fs::path toShortPath(const std::fs::path &path) {
|
||||||
#if defined(OS_WINDOWS)
|
#if defined(OS_WINDOWS)
|
||||||
size_t size = GetShortPathNameW(path.c_str(), nullptr, 0) * sizeof(TCHAR);
|
size_t size = GetShortPathNameW(path.c_str(), nullptr, 0);
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
return path;
|
return path;
|
||||||
|
|
||||||
std::wstring newPath(size, 0x00);
|
std::wstring newPath(size, 0x00);
|
||||||
GetShortPathNameW(path.c_str(), newPath.data(), newPath.size());
|
GetShortPathNameW(path.c_str(), newPath.data(), newPath.size());
|
||||||
|
newPath.pop_back();
|
||||||
|
|
||||||
return newPath;
|
return newPath;
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user