fix: ignore blank lines in reflow prefix detection

This commit is contained in:
CJ van den Berg 2026-02-02 11:45:06 +01:00
parent f55885c48e
commit 919c87e988
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -64,10 +64,10 @@ fn detect_prefix(text: []const u8) Prefix {
const line1 = lines.next() orelse return .{};
var prefix: []const u8 = line1;
var count: usize = 0;
while (lines.next()) |line| {
while (lines.next()) |line| if (line.len > 0) {
prefix = lcp(prefix, line);
count += 1;
}
};
if (count < 1) return .{
.len = 0,
.first = &.{},