Explicitly use ANSI versions of Windows functions, due to changes in Qt6 Unicode behavior. (#1727)

This commit is contained in:
William D. Jones 2026-05-22 10:21:51 -04:00 committed by GitHub
parent ee605e2b18
commit 3a3b273f06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -138,10 +138,10 @@ std::string proc_self_dirname()
WCHAR longpath[MAX_PATH + 1];
TCHAR shortpath[MAX_PATH + 1];
#endif
if (!GetModuleFileName(0, longpath, MAX_PATH + 1))
log_error("GetModuleFileName() failed.\n");
if (!GetShortPathName(longpath, shortpath, MAX_PATH + 1))
log_error("GetShortPathName() failed.\n");
if (!GetModuleFileNameA(0, longpath, MAX_PATH + 1))
log_error("GetModuleFileNameA() failed.\n");
if (!GetShortPathNameA(longpath, shortpath, MAX_PATH + 1))
log_error("GetShortPathNameA() failed.\n");
while (shortpath[i] != 0)
i++;
while (i > 0 && shortpath[i - 1] != '/' && shortpath[i - 1] != '\\')