From 74c8e2baf22c62b8015daf1b86e58fa4bf738bb4 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 25 Aug 2025 20:05:19 +0200 Subject: Update to Zig 0.15.1. --- src/cmd/external.zig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/cmd/external.zig') diff --git a/src/cmd/external.zig b/src/cmd/external.zig index 3aaa7af..befd746 100644 --- a/src/cmd/external.zig +++ b/src/cmd/external.zig @@ -26,12 +26,12 @@ pub const External = struct { .capture => true, }; // Try to execute external command - var child_args = ArrayList([]const u8).init(allocator); - defer child_args.deinit(); + var child_args = ArrayList([]const u8){}; + defer child_args.deinit(allocator); - try child_args.append(external.program); + try child_args.append(allocator, external.program); for (external.args.items) |arg| { - try child_args.append(arg); + try child_args.append(allocator, arg); } var child = std.process.Child.init(child_args.items, allocator); @@ -72,7 +72,9 @@ pub const External = struct { // Handle input redirection if (input_source) |source| { if (child.stdin) |stdin| { - const writer = stdin.writer(); + var writer_buffer: [1024]u8 = undefined; + var file_writer = stdin.writer(&writer_buffer); + const writer = &file_writer.interface; // Reset source position for reading var temp_source = source.*; @@ -82,6 +84,7 @@ pub const External = struct { defer allocator.free(line); try writer.print("{s}\n", .{line}); } + try writer.flush(); child.stdin.?.close(); child.stdin = null; } -- cgit v1.2.1