From 78832fef2607e851c92f2ff93ac7dc4e3f8415cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sun, 28 Jun 2026 18:09:20 +0200 Subject: [PATCH 1/2] implement Path::getCurrentExecutablePath for Haiku --- lib/path.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/path.cpp b/lib/path.cpp index c4758dfeae9..0195c8b029a 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -52,6 +52,9 @@ #if defined(__APPLE__) #include #endif +#if defined(__HAIKU__) +#include +#endif /** Is the filesystem case insensitive? */ @@ -158,6 +161,17 @@ std::string Path::getCurrentExecutablePath(const char* fallback) #elif defined(__APPLE__) uint32_t size = sizeof(buf); success = (_NSGetExecutablePath(buf, &size) == 0); +#elif defined(__HAIKU__) + int32 cookie = 0; + image_info info; + while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) + { + if (info.type == B_APP_IMAGE) + { + break; + } + } + return std::string(info.name); #else const char* procPath = #ifdef __SVR4 // Solaris From a90fa63c5b52529d2f7ca09dcc722588d1e93935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 2 Jul 2026 13:14:32 +0200 Subject: [PATCH 2/2] path.cpp: format fix --- lib/path.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/path.cpp b/lib/path.cpp index 0195c8b029a..a61f4660b59 100644 --- a/lib/path.cpp +++ b/lib/path.cpp @@ -162,16 +162,16 @@ std::string Path::getCurrentExecutablePath(const char* fallback) uint32_t size = sizeof(buf); success = (_NSGetExecutablePath(buf, &size) == 0); #elif defined(__HAIKU__) - int32 cookie = 0; - image_info info; - while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) - { - if (info.type == B_APP_IMAGE) - { - break; - } - } - return std::string(info.name); + int32 cookie = 0; + image_info info; + while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) + { + if (info.type == B_APP_IMAGE) + { + break; + } + } + return std::string(info.name); #else const char* procPath = #ifdef __SVR4 // Solaris