Skip to content

Commit 81908bf

Browse files
committed
fix infinite loop
In `0.15.2` `takeDelimiterExclusive()` was changed to not advance the seek position past the delimiter, causing infinite loops when used as a while condition without manually `toss()`-ing the delimiter. `takeDelimiter()` has the intended behavior and is used instead.
1 parent 56aba9e commit 81908bf

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

build/ClarTestStep.zig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
7575
var node: ?std.Progress.Node = null;
7676
defer if (node) |n| n.end();
7777

78-
while (r.takeDelimiterExclusive('\n')) |line| {
79-
switch (try parser.parseLine(arena, line)) {
78+
while (r.takeDelimiter('\n')) |line| {
79+
switch (try parser.parseLine(arena, line orelse break)) {
8080
.start_suite => |suite| {
8181
if (node) |n| n.end();
8282
node = options.progress_node.start(suite, 0);
@@ -95,9 +95,8 @@ fn make(step: *Step, options: Step.MakeOptions) !void {
9595
.feed_line => {},
9696
}
9797
} else |err| switch (err) {
98-
error.EndOfStream => {}, // @Todo: parse ending line to ensure the stream didn't end early
9998
error.ReadFailed => return file_reader.err.?,
100-
else => return err,
99+
error.StreamTooLong => return error.TapLineTooLong,
101100
}
102101

103102
const term = try child.wait();

0 commit comments

Comments
 (0)