diff options
| author | skidau <skidau@gmail.com> | 2015-07-20 14:09:36 +1000 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2015-07-20 14:09:36 +1000 |
| commit | ad68de59bcfe8aa7c84d4d66db4abd25c4477090 (patch) | |
| tree | ac7027325a3d3b73892b110a4f0725b54b319309 /Source/Core/Common/FileUtil.cpp | |
| parent | 654c44b87079897ef857f87713d39a292afc3f0a (diff) | |
| parent | c5b81b1aff9d9f34bac41da71ae02905fe4ee913 (diff) | |
Merge pull request #2665 from AdmiralCurtiss/relative-memory-card-paths
GameCube Config: Store paths relatively when selected file is within Dolphin's directory. (Windows)
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 4709c011b2..0b4a99bbd7 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -731,8 +731,12 @@ std::string& GetExeDirectory() if (DolphinPath.empty()) { TCHAR Dolphin_exe_Path[2048]; + TCHAR Dolphin_exe_Clean_Path[MAX_PATH]; GetModuleFileName(nullptr, Dolphin_exe_Path, 2048); - DolphinPath = TStrToUTF8(Dolphin_exe_Path); + if (_tfullpath(Dolphin_exe_Clean_Path, Dolphin_exe_Path, MAX_PATH) != nullptr) + DolphinPath = TStrToUTF8(Dolphin_exe_Clean_Path); + else + DolphinPath = TStrToUTF8(Dolphin_exe_Path); DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\')); } return DolphinPath; |
