From 21b5f90a33f8e38ecdd3ca9dc3b167a7b8fba30c Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 10 Oct 2024 08:37:59 +0200 Subject: Small changed to command line argument handling --- src/core.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index b95c3e37..5ddc4231 100644 --- a/src/core.c +++ b/src/core.c @@ -1891,19 +1891,22 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf if(!box64_nobanner) PrintBox64Version(); // precheck, for win-preload - if(strstr(prog, "wine-preloader")==(prog+strlen(prog)-strlen("wine-preloader")) - || strstr(prog, "wine64-preloader")==(prog+strlen(prog)-strlen("wine64-preloader"))) { + const char* prog_ = strrchr(prog, '/'); + if(!prog_) prog_ = prog; else ++prog_; + if(!strcmp(prog_, "wine-preloader") || !strcmp(prog_, "wine64-preloader")) { // wine-preloader detecter, skipping it if next arg exist and is an x86 binary int x64 = (nextarg9 && !strcmp(prog+strlen(prog)-strlen("/wineserver"), "/wineserver"))) { + } else if(!strcmp(prog_, "wineserver")) { // check if this is wineserver box64_wine = 1; } @@ -1995,7 +1996,7 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf // Append ld_list if it exist if(ld_libs_args!=-1) PrependList(&my_context->box64_ld_lib, argv[ld_libs_args], 1); - if(is_custom_gstreamer) + if(is_custom_gstreamer) //TODO: is this still needed? AddPath("libwayland-client.so.0", &my_context->box64_emulated_libs, 0); my_context->box64path = ResolveFile(argv[0], &my_context->box64_path); -- cgit 1.4.1