Skip to content

Commit

Permalink
Update subprocess.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Dec 31, 2024
1 parent 84b7888 commit 3a0bd1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bun.js/api/bun/subprocess.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1717,8 +1717,10 @@ pub const Subprocess = struct {

var actual_argv0: [:0]const u8 = "";

if (PATH.len == 0) {
if (PATH.len == 0 and argv0 == null) {
actual_argv0 = try allocator.dupeZ(u8, arg0.slice());
} else if (PATH.len > 0 and argv0 != null) {
actual_argv0 = try allocator.dupeZ(u8, bun.sliceTo(argv0.?, 0));
} else if (argv0 == null) {
const resolved = Which.which(path_buf, PATH, cwd, arg0.slice()) orelse {
return throwCommandNotFound(globalThis, arg0.slice());
Expand Down

0 comments on commit 3a0bd1f

Please sign in to comment.