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); diff --git a/src/steam.c b/src/steam.c index 8859ce05..c32de63b 100644 --- a/src/steam.c +++ b/src/steam.c @@ -137,10 +137,11 @@ void pressure_vessel(int argc, const char** argv, int nextarg, const char* prog) my_context = NewBox64Context(argc - nextarg); int x86 = my_context->box86path?FileIsX86ELF(argv[nextarg]):0; int x64 = my_context->box64path?FileIsX64ELF(argv[nextarg]):0; + int sh = my_context->bashpath?FileIsShell(argv[nextarg]):0; // create the new argv array const char** newargv = (const char**)box_calloc((argc-nextarg)+1+((x86 || x64)?1:0), sizeof(char*)); - if(x86 || x64) { - newargv[0] = x64?my_context->box64path:my_context->box86path; + if(x86 || x64 || sh) { + newargv[0] = x86?my_context->box86path:my_context->box64path; printf_log(LOG_DEBUG, "argv[%d]=\"%s\"\n", 0, newargv[0]); for(int i=nextarg; i