From 9e8ac2b6664b03116d7991d57ddb37c8108fffec Mon Sep 17 00:00:00 2001 From: Ryan Liptak Date: Sat, 17 Dec 2022 03:34:59 -0800 Subject: [PATCH] spawnWindows: Don't search PATH if app path is absolute --- lib/std/child_process.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig index 2c99f58b88..956ee2adaf 100644 --- a/lib/std/child_process.zig +++ b/lib/std/child_process.zig @@ -997,6 +997,9 @@ pub const ChildProcess = struct { } } + // No need to search the PATH if the app path is absolute + if (fs.path.isAbsoluteWindowsWTF16(app_path_w)) return no_path_err; + // app_path_w has the cwd prepended to it if cwd is non-null, so when // searching the PATH we should make sure we use the app_name verbatim. var app_name_w_needs_free = false;