get_program_exe_path
needs additional porting and improvements
#96
Labels
get_program_exe_path
needs additional porting and improvements
#96
get_program_exe_path()
is subject to overflow on long paths and it only works on Linux, Cygwin, and macOS.I ported the libsir
_sir_getappfilename
function to work on 17 platforms: Linux, Android, macOS, IBM AIX, IBM i (OS/400), Windows, Cygwin, FreeBSD, NetBSD, OpenBSD, DragonFly BSD, GNU/Hurd, Haiku, Solaris, illumos, SerenityOS, and Emscripten.This was especially complicated to get working right without too many edge cases on OpenBSD, AIX, and IBM i. This functionality on all platforms is heavily tested and proven.
You can use actually use it as a direct drop-in replacement.
Here is a patch if you want to try it. It assumes
libsir
in./libsir
:I know you probably don't want to bring in
libsir
as a dependency/subtree/submodule (although it does have a lot of other nice features you could use).It is actually trivial to get Linux, Android, NetBSD, Solaris, illumos, Dragonfly BSD, Hurd, and SerenityOS working. I've made a PR for that (#97).
Haiku will be easy too.
Extracting the functionality needed to implement this for OpenBSD, AIX, and IBM i (OS/400) — without libsir — would be a much larger project, but is of course possible.
The text was updated successfully, but these errors were encountered: