summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
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;