Zig 0.16: Skip the bytes already read as head in JSON import

This commit is contained in:
LN Liberda 2026-05-29 22:52:40 +02:00
parent fa2d9d062e
commit 595e046de3

View file

@ -532,6 +532,7 @@ pub fn import(fd: std.Io.File, head: []const u8) void {
var rbuf: [1024]u8 = undefined;
var p = Parser{.rd = fd.reader(main.io, &rbuf)};
p.rd.seekBy(@intCast(head.len)) catch p.die("Failed seek");
defer if (p.zstd) |z| z.destroy();
if (head.len >= 4 and std.mem.eql(u8, head[0..4], "\x28\xb5\x2f\xfd")) {