Path: Prevent Path::RealPath from returning '.' and '..' components

This commit is contained in:
chaoticgd 2024-12-09 08:11:30 +00:00 committed by Ty
parent 68e6ede47e
commit 0c21023bb2
1 changed files with 5 additions and 0 deletions

View File

@ -453,6 +453,11 @@ std::string Path::RealPath(const std::string_view path)
}
}
}
// If any relative symlinks were resolved, there may be '.' and '..'
// components in the resultant path, which must be removed.
realpath = Path::Canonicalize(realpath);
#endif
return realpath;