mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 23:29:17 +00:00
IOS HLE: Prevent accessing host file system
This commit is contained in:
parent
a79c449493
commit
141f3bfb3a
3 changed files with 43 additions and 5 deletions
|
@ -5,6 +5,7 @@
|
|||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
|
@ -30,7 +31,6 @@
|
|||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <libgen.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
@ -712,6 +712,19 @@ std::string GetBundleDirectory()
|
|||
}
|
||||
#endif
|
||||
|
||||
std::string GetAbsolutePath(const std::string& path)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
wchar_t absolute_path[_MAX_PATH];
|
||||
wchar_t* result = _wfullpath(absolute_path, UTF8ToTStr(path).c_str(), _MAX_PATH);
|
||||
return result ? TStrToUTF8(result) : "";
|
||||
#else
|
||||
char absolute_path[MAX_PATH + 1];
|
||||
char* result = realpath(path.c_str(), absolute_path);
|
||||
return result ? result : "";
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string& GetExeDirectory()
|
||||
{
|
||||
static std::string DolphinPath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue