mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Implement RPCS3_CONFIG_DIR env variable (Win32)
Overrides config location, should end with / or \
This commit is contained in:
parent
bc27f5f75c
commit
20efed66e9
@ -1384,8 +1384,9 @@ const std::string& fs::get_config_dir()
|
||||
std::string dir;
|
||||
|
||||
#ifdef _WIN32
|
||||
wchar_t buf[2048];
|
||||
if (GetModuleFileName(NULL, buf, ::size32(buf)) - 1 >= ::size32(buf) - 1)
|
||||
wchar_t buf[32768];
|
||||
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, std::size(buf)) - 1 >= std::size(buf) - 1 &&
|
||||
GetModuleFileName(NULL, buf, std::size(buf)) - 1 >= std::size(buf) - 1)
|
||||
{
|
||||
MessageBoxA(0, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
|
||||
return dir; // empty
|
||||
|
Loading…
Reference in New Issue
Block a user