DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 1d66bb2dd633aa6df30850bae411484e3f4434fe
parent 145f3f9a252cf76d79da451ccfdca1c32ede0050
Author: lucianoiam <oss@lucianoiam.com>
Date:   Sun, 24 Oct 2021 23:22:45 +0200

Return abs. path in getBinaryFilename() Linux/Jack (#344)

* Return abs. path in getBinaryFilename() Linux/Jack

Ensure this function always returns an absolute path by calling realpath()

* Adjust includes in b1294ec
Diffstat:
Mdistrho/src/DistrhoUtils.cpp | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/distrho/src/DistrhoUtils.cpp b/distrho/src/DistrhoUtils.cpp @@ -24,6 +24,8 @@ # include <windows.h> #else # include <dlfcn.h> +# include <limits.h> +# include <stdlib.h> #endif #if defined(DISTRHO_OS_WINDOWS) && !DISTRHO_IS_STANDALONE @@ -60,7 +62,8 @@ const char* getBinaryFilename() #else Dl_info info; dladdr((void*)getBinaryFilename, &info); - filename = info.dli_fname; + char filenameBuf[PATH_MAX]; + filename = realpath(info.dli_fname, filenameBuf); #endif return filename;