diff options
| -rw-r--r-- | std/build.zig | 7 | ||||
| -rw-r--r-- | std/os/index.zig | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/std/build.zig b/std/build.zig index 65b2c54eb1..47b051d26c 100644 --- a/std/build.zig +++ b/std/build.zig @@ -150,9 +150,10 @@ pub const Builder = struct { } // TODO issue #301 - var child = %return os.ChildProcess.spawn(self.zig_exe, zig_args.toSliceConst(), &env_map, - StdIo.Ignore, StdIo.Inherit, StdIo.Inherit, self.allocator); - const term = %return child.wait(); + var child = os.ChildProcess.spawn(self.zig_exe, zig_args.toSliceConst(), &env_map, + StdIo.Ignore, StdIo.Inherit, StdIo.Inherit, self.allocator) + %% |err| debug.panic("Unable to spawn zig compiler: {}\n", @errorName(err)); + const term = %%child.wait(); const exe_result = switch (term) { Term.Clean => |code| { if (code != 0) { diff --git a/std/os/index.zig b/std/os/index.zig index 7412fad82f..90ff053dba 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -215,8 +215,8 @@ pub fn posixExecve(path: []const u8, argv: []const []const u8, env_map: &const B const argv_buf = %return allocator.alloc(?&const u8, argv.len + 2); mem.set(?&const u8, argv_buf, null); defer { - for (argv_buf) |arg, i| { - const arg_buf = if (const ptr ?= arg) ptr[0...argv[i].len + 1] else break; + for (argv_buf) |arg| { + const arg_buf = if (const ptr ?= arg) ptr[0...cstr.len(ptr)] else break; allocator.free(arg_buf); } allocator.free(argv_buf); @@ -242,7 +242,7 @@ pub fn posixExecve(path: []const u8, argv: []const []const u8, env_map: &const B const envp_buf = %return allocator.alloc(?&const u8, envp_count + 1); mem.set(?&const u8, envp_buf, null); defer { - for (envp_buf) |env, i| { + for (envp_buf) |env| { const env_buf = if (const ptr ?= env) ptr[0...cstr.len(ptr)] else break; allocator.free(env_buf); } |
