diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-10 21:51:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 21:51:57 +0300 |
| commit | 425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch) | |
| tree | e52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig | |
| parent | 90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff) | |
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig')
| -rw-r--r-- | vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig b/vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig index c40c0a9c..555734ab 100644 --- a/vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig +++ b/vendor/libghostty-vt/src/build/wasm_patch_growable_table.zig @@ -12,15 +12,13 @@ const std = @import("std"); const testing = std.testing; const Allocator = std.mem.Allocator; -pub fn main() !void { +pub fn main(init: std.process.Init) !void { // This is a one-off patcher, so we leak all our memory on purpose // and let the OS clean it up when we exit. - var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init; - const alloc = gpa.allocator(); + const alloc = init.arena.allocator(); // Parse args: program input output - const args = try std.process.argsAlloc(alloc); - defer std.process.argsFree(alloc, args); + const args = try init.minimal.args.toSlice(alloc); if (args.len != 3) { std.log.err("usage: wasm_growable_table <input.wasm> <output.wasm>", .{}); std.process.exit(1); @@ -30,17 +28,18 @@ pub fn main() !void { // Patch the file. const output: []const u8 = try patchTableGrowable( alloc, - try std.fs.cwd().readFileAlloc( - alloc, + try std.Io.Dir.cwd().readFileAlloc( + init.io, args[1], - std.math.maxInt(usize), + alloc, + .unlimited, ), ); // Write our output - const out_file = try std.fs.cwd().createFile(args[2], .{}); - defer out_file.close(); - try out_file.writeAll(output); + const out_file = try std.Io.Dir.cwd().createFile(init.io, args[2], .{}); + defer out_file.close(init.io); + try out_file.writePositionalAll(init.io, output, 0); } /// Patch the WASM binary's table section to remove the maximum size |
