diff options
Diffstat (limited to 'loader/loader-impl.cpp')
-rw-r--r-- | loader/loader-impl.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/loader/loader-impl.cpp b/loader/loader-impl.cpp index 62fad6de..a7716000 100644 --- a/loader/loader-impl.cpp +++ b/loader/loader-impl.cpp @@ -167,14 +167,10 @@ void loader_impl::set_application_working_directory() once = true; if (const auto loc = Path::executableLocation()) { - auto path = *loc; - if (const auto pos = path.findLast('/'); pos) - { - const auto size = std::size_t(pos.data() - path.data()); - path = path.prefix(size); - loader_detail::chdir(Path::join(path, "..")); - return; - } + StringView path = *loc; + path = Path::split(path).first(); + path = Path::split(path).first(); + loader_detail::chdir(path); } fm_warn("can't find install prefix!"); } |