mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 17:23:40 +01:00
Windows: Make TEMP dir detection long path aware.
This commit is contained in:
1 parent
61e4818419
commit
dc26fb8ef7
1 file changed
+8
-2
+8
-2
@@ -96,8 +96,14 @@ static bool IsTempPath(const std::string &str) {
|
||||
// Normalize slashes.
|
||||
item = ReplaceAll(str, "/", "\\");
|
||||
|
||||
wchar_t tempPath[MAX_PATH];
|
||||
GetTempPath(MAX_PATH, tempPath);
|
||||
std::wstring tempPath(MAX_PATH, '\0');
|
||||
size_t sz = GetTempPath((DWORD)tempPath.size(), &tempPath[0]);
|
||||
if (sz >= tempPath.size()) {
|
||||
tempPath.resize(sz);
|
||||
sz = GetTempPath((DWORD)tempPath.size(), &tempPath[0]);
|
||||
}
|
||||
// Need to resize off the null terminator either way.
|
||||
tempPath.resize(sz);
|
||||
if (testPath(ConvertWStringToUTF8(tempPath)))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user