summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2015-06-26 23:43:45 +0200
committerAdmiral H. Curtiss <pikachu025@gmail.com>2015-06-26 23:51:40 +0200
commitdf70f50fdfcc69726f7d8fd186054dbe3e68c57e (patch)
treed2df4b613aa77c3e2bd1ab698e34adad01810e81 /Source/Core/Common/FileUtil.cpp
parent6818f2e092ee0484fce7403414ddcd6dfcc38fab (diff)
GetExeDirectory() shouldn't return paths with /../ in the middle.
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;