about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-09-16 15:30:39 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-09-16 15:30:39 +0200
commitbff3b935fb73468d3d1435a5366c6082449a46e9 (patch)
tree3b4b87b8846e285f4f11c7303c995692f5a0e6bd /src
parent9faa9f41e0efe81fe75ca61c6a4475fa62b35d0d (diff)
downloadbox64-bff3b935fb73468d3d1435a5366c6082449a46e9.tar.gz
box64-bff3b935fb73468d3d1435a5366c6082449a46e9.zip
Better handling of argv[0]
Diffstat (limited to 'src')
-rw-r--r--src/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index 2e91eef2..b89b7f76 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2000,7 +2000,10 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
     PrintCollection(&my_context->box64_path, "BOX64 BIN PATH");
     // lets build argc/argv stuff
     printf_log(LOG_INFO, "Looking for %s\n", prog);
-    my_context->argv[0] = ResolveFileSoft(prog, &my_context->box64_path);
+    if(strchr(prog, '/'))
+        my_context->argv[0] = box_strdup(prog);
+    else
+        my_context->argv[0] = ResolveFileSoft(prog, &my_context->box64_path);
     // check if box86 is present
     {
         my_context->box86path = box_strdup(my_context->box64path);