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(...@@ -1131,7 +1131,7 @@ pub fn execve(
1131 defer arena_allocator.deinit();1131 defer arena_allocator.deinit();
1132 const arena = arena_allocator.allocator();1132 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);
1135 for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr;1135 for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr;
11361136
1137 const envp = m: {1137 const envp = m: {
...@@ -1143,7 +1143,7 @@ pub fn execve(...@@ -1143,7 +1143,7 @@ pub fn execve(
1143 } else if (builtin.output_mode == .Exe) {1143 } else if (builtin.output_mode == .Exe) {
1144 // Then we have Zig start code and this works.1144 // Then we have Zig start code and this works.
1145 // TODO type-safety for null-termination of `os.environ`.1145 // 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);
1147 } else {1147 } else {
1148 // TODO come up with a solution for this.1148 // TODO come up with a solution for this.
1149 @compileError("missing std lib enhancement: std.process.execv implementation has no way to collect the environment variables to forward to the child process");1149 @compileError("missing std lib enhancement: std.process.execv implementation has no way to collect the environment variables to forward to the child process");