Fix get_bundle_root() on Linux

master
Marius Petcu 2019-09-26 09:47:12 +03:00
parent 818809d6e1
commit c87e4538b8
1 changed files with 1 additions and 0 deletions

View File

@ -826,6 +826,7 @@ char* defos_get_bundle_root()
char* path = (char*)malloc(PATH_MAX + 2);
ssize_t ret = readlink("/proc/self/exe", path, PATH_MAX + 2);
if (ret >= 0 && ret <= PATH_MAX + 1) {
path[ret] = '\0';
result = copy_string(dirname(path));
} else {
const char* path2 = (const char*)getauxval(AT_EXECFN);