From 830fa5fbfc5aaaa4d3b08a8d84142e9bf9137be1 Mon Sep 17 00:00:00 2001 From: Anthony Date: Mon, 11 Mar 2024 00:08:23 +0100 Subject: [PATCH] fix regression --- story-editor/src/platform_folders.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/story-editor/src/platform_folders.cpp b/story-editor/src/platform_folders.cpp index 64dd1f0..c9a49a4 100644 --- a/story-editor/src/platform_folders.cpp +++ b/story-editor/src/platform_folders.cpp @@ -207,6 +207,19 @@ std::string getExecutablePath() #include // PATH_MAX +namespace pf +{ + std::string getExecutablePath() + { + char result[PATH_MAX]; + ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); + const char *path; + if (count != -1) { + path = dirname(result); + } + return path; + } +} static void throwOnRelative(const char *envName, const char *envValue) { @@ -271,18 +284,6 @@ namespace pf } #endif - - std::string getExecutablePath() - { - char result[PATH_MAX]; - ssize_t count = readlink("/proc/self/exe", result, PATH_MAX); - const char *path; - if (count != -1) { - path = dirname(result); - } - return path; - } - std::string getDataHome() { #ifdef _WIN32