mirror of https://github.com/PCSX2/pcsx2.git
FileSystem: Improve handling of relative paths in RealPath()
This commit is contained in:
parent
17b770f250
commit
8cd5bd3df1
|
@ -288,8 +288,14 @@ std::string Path::RealPath(const std::string_view path)
|
||||||
{
|
{
|
||||||
// Resolve non-absolute paths first.
|
// Resolve non-absolute paths first.
|
||||||
std::vector<std::string_view> components;
|
std::vector<std::string_view> components;
|
||||||
|
// We need to keep the full combined path in scope
|
||||||
|
// as SplitNativePath() returns string_views to it.
|
||||||
|
std::string buf;
|
||||||
if (!IsAbsolute(path))
|
if (!IsAbsolute(path))
|
||||||
components = Path::SplitNativePath(Path::Combine(FileSystem::GetWorkingDirectory(), path));
|
{
|
||||||
|
buf = Path::Combine(FileSystem::GetWorkingDirectory(), path);
|
||||||
|
components = Path::SplitNativePath(buf);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
components = Path::SplitNativePath(path);
|
components = Path::SplitNativePath(path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue