fix windows

This commit is contained in:
Mitchell Hashimoto
2025-03-12 16:14:23 -07:00
parent 907ed239a1
commit fc21444f2d
4 changed files with 18 additions and 15 deletions

View File

@@ -193,11 +193,11 @@ fn startPosix(self: *Command, arena: Allocator) !void {
}
fn startWindows(self: *Command, arena: Allocator) !void {
const application_w = try std.unicode.utf8ToUtf16LeWithNull(arena, self.path);
const cwd_w = if (self.cwd) |cwd| try std.unicode.utf8ToUtf16LeWithNull(arena, cwd) else null;
const application_w = try std.unicode.utf8ToUtf16LeAllocZ(arena, self.path);
const cwd_w = if (self.cwd) |cwd| try std.unicode.utf8ToUtf16LeAllocZ(arena, cwd) else null;
const command_line_w = if (self.args.len > 0) b: {
const command_line = try windowsCreateCommandLine(arena, self.args);
break :b try std.unicode.utf8ToUtf16LeWithNull(arena, command_line);
break :b try std.unicode.utf8ToUtf16LeAllocZ(arena, command_line);
} else null;
const env_w = if (self.env) |env_map| try createWindowsEnvBlock(arena, env_map) else null;