Skip to content

Commit

Permalink
Merge pull request #3914 from bylaws/wincfg
Browse files Browse the repository at this point in the history
Config: Search more locations for the config directory on Windows
  • Loading branch information
Sonicadvance1 authored Aug 1, 2024
2 parents c3c2b61 + cb6d60a commit 1f59f0e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Source/Common/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,21 @@ const char* GetHomeDirectory() {
}
#else
const char* GetHomeDirectory() {
const char* HomeObjectPath = getenv("WINEHOMEDIR");
if (!HomeObjectPath) {
return nullptr;
const char* HomeDir = getenv("WINEHOMEDIR");
if (HomeDir) {
// Skip over the \??\ prefix in the NT path since we want a DOS path
HomeDir += 4;
};

if (!HomeDir) {
HomeDir = getenv("LOCALAPPDATA");
}

if (!HomeDir) {
HomeDir = ".";
}

// Skip over the \??\ prefix in the NT path since we want a DOS path
return HomeObjectPath + 4;
return HomeDir;
}
#endif

Expand Down

0 comments on commit 1f59f0e

Please sign in to comment.