Make sure that local path has a trailing slash on Linux and Windows

7098-improve-post-process-behavior-with-transparent-objects
Andrei Kortunov 2 years ago
parent f4ac32efc9
commit b0d687964e

@ -83,7 +83,8 @@ namespace Files
std::filesystem::path LinuxPath::getLocalPath() const std::filesystem::path LinuxPath::getLocalPath() const
{ {
auto localPath = std::filesystem::current_path(); auto localPath = std::filesystem::current_path() / "";
static const std::filesystem::path statusPaths[] static const std::filesystem::path statusPaths[]
= { "/proc/self/exe", "/proc/self/file", "/proc/curproc/exe", "/proc/curproc/file" }; = { "/proc/self/exe", "/proc/self/file", "/proc/curproc/exe", "/proc/curproc/file" };
@ -93,7 +94,7 @@ namespace Files
const auto binPath = read_symlink(path, ec); const auto binPath = read_symlink(path, ec);
if (ec.value() != -1) if (ec.value() != -1)
{ {
localPath = binPath.parent_path(); localPath = binPath.parent_path() / "";
break; break;
} }
} }

@ -70,13 +70,13 @@ namespace Files
std::filesystem::path WindowsPath::getLocalPath() const std::filesystem::path WindowsPath::getLocalPath() const
{ {
std::filesystem::path localPath = std::filesystem::current_path(); std::filesystem::path localPath = std::filesystem::current_path() / "";
WCHAR path[MAX_PATH + 1] = {}; WCHAR path[MAX_PATH + 1] = {};
if (GetModuleFileNameW(nullptr, path, MAX_PATH + 1) > 0) if (GetModuleFileNameW(nullptr, path, MAX_PATH + 1) > 0)
{ {
localPath = std::filesystem::path(path).parent_path(); localPath = std::filesystem::path(path).parent_path() / "";
} }
// lookup exe path // lookup exe path

Loading…
Cancel
Save