Commit 61195e4a8fced6f4b872c8351c724f7753b19f53

Thomas de Grivel 2023-12-01T13:34:17

wip segv

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/libc3/env.c b/libc3/env.c
index d5ce72d..c36860b 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -787,7 +787,7 @@ s_env * env_init_args (s_env *env, int argc, s8 **argv)
     env->argc = argc;
     env->argv = argv;
     str_init_1(&argv0, NULL, argv[0]);
-    file_dirname(&dir, &argv0);
+    file_dirname(&argv0, &dir);
     buf_init(&buf, false, sizeof(a), a);
     if ((r = buf_write_str(&buf, &dir)) < 0 ||
         (r = buf_write_u8(&buf, '/') < 0))