From e2d87f554be8e02297c416cf633f5d2d5146b08a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 11 Apr 2024 14:44:29 +1000 Subject: [PATCH] FileSystem: Canonicalize() after RealPath() --- src/common/file_system.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/file_system.cpp b/src/common/file_system.cpp index 96947f67b..8d5fc02a1 100644 --- a/src/common/file_system.cpp +++ b/src/common/file_system.cpp @@ -465,6 +465,10 @@ std::string Path::RealPath(const std::string_view& path) } #endif + // Get rid of any current/parent directory components before returning. + // This should be fine on Linux, since any symbolic links have already replaced the leading portion. + Path::Canonicalize(&realpath); + return realpath; }