commit fd28b9d5013fe27f8885e117b8d410f3be462c56 (tree)
parent ac4e38226b45081dfb66f006bba38b11c121ad45
Author: Andrew Kelley <andrew@ziglang.org>
Date: Tue, 5 Feb 2019 21:03:33 -0500
Merge pull request #1919 from Sahnvour/windows-childprocess
Better behaviour of ChildProcess under windows.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/std/os/child_process.zig b/std/os/child_process.zig
@@ -600,7 +600,7 @@ pub const ChildProcess = struct {
const joined_path = try os.path.join(self.allocator, search_path, app_name);
defer self.allocator.free(joined_path);
- const joined_path_w = try unicode.utf8ToUtf16LeWithNull(self.allocator, app_name);
+ const joined_path_w = try unicode.utf8ToUtf16LeWithNull(self.allocator, joined_path);
defer self.allocator.free(joined_path_w);
if (windowsCreateProcess(joined_path_w.ptr, cmd_line_w.ptr, envp_ptr, cwd_w_ptr, &siStartInfo, &piProcInfo)) |_| {
@@ -610,6 +610,9 @@ pub const ChildProcess = struct {
} else {
return err;
}
+ } else {
+ // Every other error would have been returned earlier.
+ return error.FileNotFound;
}
};