about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-10-10 15:11:52 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-10-10 15:11:52 +0200
commitc6cd9ceb759ae28c84bc203ea6989984d972ca91 (patch)
treed1a362c24b6903df47d0af50296fbbc0a1bef677
parentce735357d61dcd446b7d219c56d365e3a35edeaf (diff)
downloadbox64-c6cd9ceb759ae28c84bc203ea6989984d972ca91.tar.gz
box64-c6cd9ceb759ae28c84bc203ea6989984d972ca91.zip
Fixed some command line handling regression
-rw-r--r--src/core.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index 5ddc4231..8a72e009 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1896,12 +1896,17 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
     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 = (nextarg<argc)?FileIsX64ELF(argv[nextarg]):0;
-        if(x64) {
+        #ifdef BOX32
+        int x86 = (nextarg<argc)?FileIsX86ELF(argv[nextarg]):0;
+        #else
+        int x86 = 0;
+        #endif
+        if(x64 || x86) {
             prog = argv[++nextarg];
             printf_log(LOG_INFO, "BOX64: Wine preloader detected, loading \"%s\" directly\n", prog);
             wine_preloaded = 1;
             prog_ = strrchr(prog, '/');
-            if(!prog_) prog_ = prog; else ++prog;
+            if(!prog_) prog_ = prog; else ++prog_;
         }
     }
     #ifndef STATICBUILD