authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-06-01 21:03:33-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-10 20:47:58-07:00
logdc18739a738adc7fd549f9d43db2314275c51c03
tree296b0e262677a6c3845509dec6144b3e92e41718
parente2174428e81fc5d84c54ae4833002d943adab38a

process: add more missing const


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/process.zig+2-2
......@@ -1131,7 +1131,7 @@ pub fn execve(
11311131 defer arena_allocator.deinit();
11321132 const arena = arena_allocator.allocator();
11331133
1134 const argv_buf = try arena.allocSentinel(?[*:0]u8, argv.len, null);
1134 const argv_buf = try arena.allocSentinel(?[*:0]const u8, argv.len, null);
11351135 for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr;
11361136
11371137 const envp = m: {
......@@ -1143,7 +1143,7 @@ pub fn execve(
11431143 } else if (builtin.output_mode == .Exe) {
11441144 // Then we have Zig start code and this works.
11451145 // TODO type-safety for null-termination of `os.environ`.
1146 break :m @ptrCast([*:null]?[*:0]u8, os.environ.ptr);
1146 break :m @ptrCast([*:null]?[*:0]const u8, os.environ.ptr);
11471147 } else {
11481148 // TODO come up with a solution for this.
11491149 @compileError("missing std lib enhancement: std.process.execv implementation has no way to collect the environment variables to forward to the child process");