[PATCH] Added support for GNU Hurd in OFgetExecutablePath().
authorMarco Eichelberg <eichelberg@offis.de>
Fri, 30 Jan 2026 17:21:33 +0000 (18:21 +0100)
committerÉtienne Mollier <emollier@debian.org>
Mon, 8 Jun 2026 17:14:40 +0000 (19:14 +0200)
Thanks to Pino Toscano (GitHub user pinotree) for the pull request.

This closes GitHub PR #137.

Gbp-Pq: Name hurd.patch

ofstd/libsrc/ofwhere.c

index 3b6bec18e588ba219ecb8379b870bd929864b097..3e8b3e591e6b3c80b0ca4c6c2d37d4916da27e30 100644 (file)
@@ -165,7 +165,7 @@ int OFgetExecutablePath(char* out, int capacity, int* dirname_length)
   return OFgetModulePath_(NULL, out, capacity, dirname_length);
 }
 
-#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(WAI_USE_PROC_SELF_EXE)
+#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(__GNU__) || defined(WAI_USE_PROC_SELF_EXE)
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -185,6 +185,10 @@ int OFgetExecutablePath(char* out, int capacity, int* dirname_length)
 #endif
 #endif
 
+#if !defined(PATH_MAX)
+#define PATH_MAX 1024
+#endif
+
 
 int OFgetExecutablePath(char* out, int capacity, int* dirname_length)
 {