include haiku.h in setup.c

improve haiku_get_app_path()
This commit is contained in:
Jerome Duval 2021-03-30 10:59:41 +02:00 committed by PulkoMandy
parent 3fa8c98c17
commit fd702d31b5
2 changed files with 7 additions and 5 deletions

View File

@ -63,12 +63,13 @@ char* haiku_get_clipboard()
const char* haiku_get_app_path()
{
static image_info info;
static int32 cookie = 0;
int32 cookie = 0;
if (cookie == 0) do {
get_next_image_info(B_CURRENT_TEAM, &cookie, &info);
} while (info.type != B_APP_IMAGE);
while (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
if (info.type == B_APP_IMAGE)
return info.name;
}
return info.name;
return NULL;
}
#endif

View File

@ -43,6 +43,7 @@
#include <errno.h>
#elif defined(__HAIKU__)
#include <FindDirectory.h>
#include "haiku.h"
#endif
#include "struct.h"