summaryrefslogtreecommitdiffhomepage
path: root/loader/filesystem.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-09 17:41:26 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-09 17:41:26 +0100
commita97e2a90a4508dc7936f132aebcccc08fd3305b0 (patch)
tree866ab5e78a8a7f4d09ba329f49b917caf83e970c /loader/filesystem.cpp
parent4643a85a171652a25eecfca5a7af4cf4ccb2d580 (diff)
loader, anim-crop-tool: workaround relative path usage
Diffstat (limited to 'loader/filesystem.cpp')
-rw-r--r--loader/filesystem.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/loader/filesystem.cpp b/loader/filesystem.cpp
index 850ec84f..f3a72365 100644
--- a/loader/filesystem.cpp
+++ b/loader/filesystem.cpp
@@ -38,12 +38,26 @@ bool loader_impl::chdir(StringView pathname)
return !ret;
}
+StringView loader_impl::startup_directory() noexcept
+{
+ fm_debug_assert(!original_working_directory.isEmpty());
+ return original_working_directory;
+}
+
void loader_impl::set_application_working_directory()
{
static bool once = false;
if (once)
return;
once = true;
+ if (auto loc = Path::currentDirectory(); loc)
+ original_working_directory = std::move(*loc);
+ else
+ {
+ Error err; err << "can't get original working directory:";
+ Corrade::Utility::Implementation::printErrnoErrorString(err, errno);
+ original_working_directory = "."_s;
+ }
if (const auto loc = Path::executableLocation())
{
String path;