mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
Merge branch 'version_fix' into 'master'
Make sure that local path has a trailing slash on Linux and Windows See merge request OpenMW/openmw!2528
This commit is contained in:
commit
06e21f45f3
@ -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…
x
Reference in New Issue
Block a user