return rest instead of next so values with = works
All checks were successful
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Successful in 1m36s

This commit is contained in:
Emil Lerch 2023-10-22 12:50:21 -07:00
parent 33cb2589af
commit d8b5366515
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -127,9 +127,7 @@ fn headersWithoutContext(allocator: std.mem.Allocator) !Headers {
is_header_option = false; is_header_option = false;
var split = std.mem.splitSequence(u8, arg, "="); var split = std.mem.splitSequence(u8, arg, "=");
const name = split.next().?; const name = split.next().?;
if (split.next()) |s| { try headers.append(name, split.rest());
try headers.append(name, s);
} else return error.CommandLineError;
} }
if (std.mem.startsWith(u8, arg, "-" ++ header_option.short) or if (std.mem.startsWith(u8, arg, "-" ++ header_option.short) or
std.mem.startsWith(u8, arg, "--" ++ header_option.long)) std.mem.startsWith(u8, arg, "--" ++ header_option.long))