avoid panic if rest of line is all whitespace
All checks were successful
Generic zig build / build (push) Successful in 30s
All checks were successful
Generic zig build / build (push) Successful in 30s
This commit is contained in:
parent
4bec474f7a
commit
e2b49957cd
1 changed files with 2 additions and 1 deletions
|
|
@ -331,7 +331,8 @@ pub const Value = union(enum) {
|
|||
// be a comma. If in long mode, we could have whitespace + comment
|
||||
var buf: [256]u8 = undefined;
|
||||
if (state.field_delimiter == '\n') {
|
||||
if (std.mem.trimStart(u8, past_val, std.ascii.whitespace[0..])[0] != '#') {
|
||||
const rest = std.mem.trimStart(u8, past_val, std.ascii.whitespace[0..]);
|
||||
if (rest.len > 0 and rest[0] != '#') {
|
||||
const msg = std.fmt.bufPrint(
|
||||
&buf,
|
||||
"line has {} additional bytes after field value. Perhaps length should be restated as {}?",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue