diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2012-12-14 11:47:12 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2012-12-14 11:47:12 -0600 |
| commit | 3b559d89ec39b4479bf97aa376f7e685997db0a3 (patch) | |
| tree | ac6c4e0a44643e0488804987f4afdabae3263909 /Source/Core | |
| parent | 532fdada966c2e374216f162223c1059f16e1d2d (diff) | |
If the HOME environment variable isn't set, fall back on to PWD. Closes 5584.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 4650c6e1ba..691685e99d 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -649,7 +649,7 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; else - paths[D_USER_IDX] = std::string(getenv("HOME")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; + paths[D_USER_IDX] = std::string(getenv("HOME") ? getenv("HOME") : getenv("PWD")) + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; #endif INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", paths[D_USER_IDX].c_str()); |
