mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-28 06:41:15 +00: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())
|
if (DolphinPath.empty())
|
||||||
{
|
{
|
||||||
TCHAR Dolphin_exe_Path[2048];
|
TCHAR Dolphin_exe_Path[2048];
|
||||||
|
TCHAR Dolphin_exe_Clean_Path[MAX_PATH];
|
||||||
GetModuleFileName(nullptr, Dolphin_exe_Path, 2048);
|
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('\\'));
|
DolphinPath = DolphinPath.substr(0, DolphinPath.find_last_of('\\'));
|
||||||
}
|
}
|
||||||
return DolphinPath;
|
return DolphinPath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user