Browse Source

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
pull/349/head
lucianoiam GitHub 3 years ago
parent
commit
1d66bb2dd6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      distrho/src/DistrhoUtils.cpp

+ 4
- 1
distrho/src/DistrhoUtils.cpp View File

@@ -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;


Loading…
Cancel
Save