mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-06-01 02:35:31 +00:00
Merge branch 'linux_library_path_detection' into 'master'
Fix the library path detection on Linux See merge request Mr_Goldberg/goldberg_emulator!23
This commit is contained in:
commit
f74030e7d4
|
@ -158,17 +158,17 @@ std::string get_lib_path() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
struct dirent *ep;
|
struct dirent *ep;
|
||||||
dp = opendir (dir.c_str());
|
dp = opendir (dir.c_str());
|
||||||
unsigned long long int p = (unsigned long long int)&get_lib_path;
|
uintptr_t p = (uintptr_t)&get_lib_path;
|
||||||
|
|
||||||
if (dp != NULL)
|
if (dp != NULL)
|
||||||
{
|
{
|
||||||
while ((ep = readdir (dp))) {
|
while ((ep = readdir (dp))) {
|
||||||
if (memcmp(ep->d_name, ".", 2) != 0 && memcmp(ep->d_name, "..", 3) != 0) {
|
if (memcmp(ep->d_name, ".", 2) != 0 && memcmp(ep->d_name, "..", 3) != 0) {
|
||||||
char *upper = NULL;
|
char *upper = NULL;
|
||||||
unsigned long long int lower_bound = strtoull(ep->d_name, &upper, 16);
|
uintptr_t lower_bound = strtoull(ep->d_name, &upper, 16);
|
||||||
if (lower_bound) {
|
if (lower_bound) {
|
||||||
++upper;
|
++upper;
|
||||||
unsigned long long int upper_bound = strtoull(upper, &upper, 16);
|
uintptr_t upper_bound = strtoull(upper, &upper, 16);
|
||||||
if (upper_bound && (lower_bound < p && p < upper_bound)) {
|
if (upper_bound && (lower_bound < p && p < upper_bound)) {
|
||||||
std::string path = dir + PATH_SEPARATOR + ep->d_name;
|
std::string path = dir + PATH_SEPARATOR + ep->d_name;
|
||||||
char link[PATH_MAX] = {};
|
char link[PATH_MAX] = {};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user