From bee1ae68ef1d36db8f4dfe255bef70b8ca6c4568 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 21 Apr 2017 13:12:30 -0400 Subject: std: fix PATH resolution when spawning child --- std/os/index.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'std') diff --git a/std/os/index.zig b/std/os/index.zig index 60e3c9a9b8..e9c182dafa 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -304,7 +304,7 @@ pub fn posixExecve(exe_path: []const u8, argv: []const []const u8, env_map: &con mem.copy(u8, path_buf, search_path); path_buf[search_path.len] = '/'; mem.copy(u8, path_buf[search_path.len + 1 ...], exe_path); - path_buf[search_path.len + exe_path.len + 2] = 0; + path_buf[search_path.len + exe_path.len + 1] = 0; err = posix.getErrno(posix.execve(path_buf.ptr, argv_buf.ptr, envp_buf.ptr)); assert(err > 0); if (err == errno.EACCES) { -- cgit v1.2.3