mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
GetExeDirectory() shouldn't return paths with /../ in the middle.
This commit is contained in:
parent
6818f2e092
commit
df70f50fdf
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user