From b0e025946e9e7dd7638b9ebb7279ca7a3e26b742 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 13 Oct 2020 01:57:53 -0700 Subject: [PATCH] Don't check for the app path if one was already retrieved --- alc/helpers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/alc/helpers.cpp b/alc/helpers.cpp index ce407756..1003ccfa 100644 --- a/alc/helpers.cpp +++ b/alc/helpers.cpp @@ -267,10 +267,11 @@ const PathNamePair &GetProcBinary() } #endif #ifdef __HAIKU__ - char procpath[PATH_MAX]; - if(find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, procpath, sizeof(procpath)) == B_OK) + if(pathname.empty()) { - pathname.insert(pathname.end(), procpath, procpath+strlen(procpath)); + char procpath[PATH_MAX]; + if(find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, procpath, sizeof(procpath)) == B_OK) + pathname.insert(pathname.end(), procpath, procpath+strlen(procpath)); } #endif if(pathname.empty())