Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/native/minipal/getexepath.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#include <sys/sysctl.h>
#elif defined(_WIN32)
#include <windows.h>
#elif defined(__HAIKU__)
#include <FindDirectory.h>
#include <StorageDefs.h>
#elif HAVE_GETAUXVAL
#include <sys/auxv.h>
#endif
Expand Down Expand Up @@ -61,6 +64,16 @@ static inline char* minipal_getexepath(void)
return NULL;
}

return realpath(path, NULL);
Copy link

Copilot AI Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return statement appears before the HAIKU branch, causing the Haiku-specific code to be bypassed. Consider moving this statement inside the appropriate conditional branch so that the Haiku implementations execute correctly.

Copilot uses AI. Check for mistakes.
#elif defined(__HAIKU__)
char path[B_PATH_NAME_LENGTH];
status_t status = find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, path, B_PATH_NAME_LENGTH);
if (status != B_OK)
{
errno = status;
return NULL;
}

return realpath(path, NULL);
#elif defined(_WIN32)
char path[MAX_PATH];
Expand Down
Loading