mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 12:10:06 +02:00
yamagi_quake2: fix find path (#3309)
This commit is contained in:
@@ -86,3 +86,43 @@ index a2e6f18..9397d97 100644
|
||||
--
|
||||
2.19.1
|
||||
|
||||
From 7cf68509bfbd20fe3fa84f0598973e8558c28742 Mon Sep 17 00:00:00 2001
|
||||
From: Nikolay0054 <nikolay0054@gmail.com>
|
||||
Date: Sat, 3 Nov 2018 14:10:59 +0500
|
||||
Subject: [PATCH] fix find path
|
||||
|
||||
---
|
||||
src/backends/generic/misc.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/src/backends/generic/misc.c b/src/backends/generic/misc.c
|
||||
index 973a2cba..11832be0 100644
|
||||
--- a/src/backends/generic/misc.c
|
||||
+++ b/src/backends/generic/misc.c
|
||||
@@ -45,6 +45,10 @@
|
||||
#include <mach-o/dyld.h> // _NSGetExecutablePath
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h> // find_path()
|
||||
+#endif
|
||||
+
|
||||
#ifndef PATH_MAX
|
||||
// this is mostly for windows. windows has a MAX_PATH = 260 #define, but allows
|
||||
// longer paths anyway.. this might not be the maximum allowed length, but is
|
||||
@@ -119,6 +123,13 @@ static void SetExecutablePath(char* exePath)
|
||||
// TODO: realpath() ?
|
||||
// TODO: no idea what this is if the executable is in an app bundle
|
||||
|
||||
+#elif defined(__HAIKU__)
|
||||
+
|
||||
+ if(find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, exePath, PATH_MAX) != B_OK)
|
||||
+ {
|
||||
+ exePath[0] = '\0';
|
||||
+ }
|
||||
+
|
||||
#else
|
||||
|
||||
// Several platforms (for example OpenBSD) donn't provide a
|
||||
--
|
||||
2.19.1
|
||||
|
||||
@@ -28,7 +28,7 @@ code is fully 64 bit clean and highly portable."
|
||||
HOMEPAGE="https://www.yamagi.org/quake2/"
|
||||
COPYRIGHT="OpenArena Team"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="2"
|
||||
REVISION="3"
|
||||
SOURCE_URI="https://deponie.yamagi.org/quake2/quake2-$portVersion.tar.xz"
|
||||
CHECKSUM_SHA256="f27b6d110c25feee18bbe9b414a143b52848327141b22349d7c4ef1fa46a7bbf"
|
||||
SOURCE_DIR="quake2-$portVersion"
|
||||
|
||||
Reference in New Issue
Block a user