From 4adeea3454e941f3c9609ec9215ee137b892b69c Mon Sep 17 00:00:00 2001 From: bfredl Date: Thu, 30 Oct 2025 10:29:43 +0100 Subject: [PATCH] fix(build): make patch utility work with zig 0.15.2 takeDelimiterExclusive doesn't advance the seek position after the newline anymore, leading to failures. This is noticed when building with -Dlang=lua51 --- .github/workflows/tests.yml | 2 +- build/patch.zig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f01bed5..8c3aabb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,7 +42,7 @@ jobs: - name: Setup Zig uses: mlugg/setup-zig@v2 with: - version: "0.15.1" + version: "0.15.2" - name: Run tests run: make test_zig_stable diff --git a/build/patch.zig b/build/patch.zig index 81b1f2e..b29c931 100644 --- a/build/patch.zig +++ b/build/patch.zig @@ -55,11 +55,11 @@ pub fn main() !void { const chunk = chunk_details.lines[line_number - chunk_details.src]; switch (chunk.action) { .remove => { - const line = try reader.interface.takeDelimiterExclusive('\n'); + const line = (try reader.interface.takeDelimiter('\n')).?; if (!std.mem.eql(u8, chunk.buf, line)) @panic("Failed to apply patch"); }, .keep => { - const line = try reader.interface.takeDelimiterExclusive('\n'); + const line = (try reader.interface.takeDelimiter('\n')).?; if (!std.mem.eql(u8, chunk.buf, line)) @panic("Failed to apply patch"); try writer.interface.writeAll(line); try writer.interface.writeByte('\n');