zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit bee1ae68ef1d36db8f4dfe255bef70b8ca6c4568 (tree)
parent 3a137c6ff0f3f0fe02db9d0fa152a1894e9db493
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Fri, 21 Apr 2017 13:12:30 -0400

std: fix PATH resolution when spawning child

Diffstat:
Mstd/os/index.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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) {