From 53b62b9f0adf6c726e23fcce530aeb333b232467 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Sat, 20 Mar 2021 12:02:08 -0700 Subject: [PATCH] util/run_cmd- increase max output bytes and free when done running --- src/util/funcs.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/funcs.zig b/src/util/funcs.zig index c7910f3ca4f9fd33079f5254a16711ef0369cd2f..ff4e269925c9bd516178399c3fdf4f2deef2cbac 100644 --- a/src/util/funcs.zig +++ b/src/util/funcs.zig @@ -158,13 +158,15 @@ pub fn file_list(dpath: []const u8, list: *std.ArrayList([]const u8)) !void { } pub fn run_cmd(dir: ?[]const u8, args: []const []const u8) !u32 { - const result = std.ChildProcess.exec(.{ .allocator = gpa, .cwd = dir, .argv = args, }) catch |e| switch(e) { + const result = std.ChildProcess.exec(.{ .allocator = gpa, .cwd = dir, .argv = args, .max_output_bytes = std.math.maxInt(usize) }) catch |e| switch(e) { error.FileNotFound => { u.assert(false, "\"{s}\" command not found", .{args[0]}); unreachable; }, else => return e, }; + gpa.free(result.stdout); + gpa.free(result.stderr); return result.term.Exited; } -- 2.54.0