Skip to content

Commit a4d08d9

Browse files
bfredlnatecraddock
authored andcommitted
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
1 parent 39f8df5 commit a4d08d9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup Zig
4343
uses: mlugg/setup-zig@v2
4444
with:
45-
version: "0.15.1"
45+
version: "0.15.2"
4646

4747
- name: Run tests
4848
run: make test_zig_stable

build/patch.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ pub fn main() !void {
5555
const chunk = chunk_details.lines[line_number - chunk_details.src];
5656
switch (chunk.action) {
5757
.remove => {
58-
const line = try reader.interface.takeDelimiterExclusive('\n');
58+
const line = (try reader.interface.takeDelimiter('\n')).?;
5959
if (!std.mem.eql(u8, chunk.buf, line)) @panic("Failed to apply patch");
6060
},
6161
.keep => {
62-
const line = try reader.interface.takeDelimiterExclusive('\n');
62+
const line = (try reader.interface.takeDelimiter('\n')).?;
6363
if (!std.mem.eql(u8, chunk.buf, line)) @panic("Failed to apply patch");
6464
try writer.interface.writeAll(line);
6565
try writer.interface.writeByte('\n');

0 commit comments

Comments
 (0)