From 1712afdae988d2d840e2220ae4a3e0de54fca05b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 16 Jun 2021 15:19:13 +0200 Subject: Improved emulated library loader, to not stop at first binary found even if not at the correct architecture --- src/librarian/library.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/librarian/library.c b/src/librarian/library.c index 7ca96e0a..992f694e 100755 --- a/src/librarian/library.c +++ b/src/librarian/library.c @@ -219,18 +219,19 @@ static void initEmulatedLib(const char* path, library_t *lib, box64context_t* co { char libname[MAX_PATH]; strcpy(libname, path); - int found = FileExist(libname, IS_FILE); - if(!found && !strchr(path, '/')) + int found = FileIsX64ELF(libname); + if(found) + if(loadEmulatedLib(libname, lib, context)) + return; + if(!strchr(path, '/')) for(int i=0; ibox64_ld_lib.size; ++i) { strcpy(libname, context->box64_ld_lib.paths[i]); strcat(libname, path); - if(FileExist(libname, IS_FILE)) + if(FileIsX64ELF(libname)) if(loadEmulatedLib(libname, lib, context)) return; } - else - loadEmulatedLib(libname, lib, context); } extern char* libGL; -- cgit 1.4.1