Commit 161eb4a000

Sébastien Marie <semarie@online.fr>
2020-10-11 14:25:16
initialize std.os.argv in stage1 compiler. it is needed for selfExePath under OpenBSD
1 parent a6dc2b7
Changed files (1)
src/stage1.zig
@@ -25,7 +25,9 @@ comptime {
 pub const log = stage2.log;
 pub const log_level = stage2.log_level;
 
-pub export fn main(argc: c_int, argv: [*]const [*:0]const u8) c_int {
+pub export fn main(argc: c_int, argv: [*][*:0]u8) c_int {
+    std.os.argv = argv[0.. @intCast(usize, argc)];
+    
     std.debug.maybeEnableSegfaultHandler();
 
     zig_stage1_os_init();