summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-07-20 14:09:36 +1000
committerskidau <skidau@gmail.com>2015-07-20 14:09:36 +1000
commitad68de59bcfe8aa7c84d4d66db4abd25c4477090 (patch)
treeac7027325a3d3b73892b110a4f0725b54b319309 /Source/Core/Common/FileUtil.cpp
parent654c44b87079897ef857f87713d39a292afc3f0a (diff)
parentc5b81b1aff9d9f34bac41da71ae02905fe4ee913 (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.cpp6
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;