fix(parse): guard not to add empty arg

This commit is contained in:
Ahurac 2024-10-06 12:02:59 +02:00
parent e5aa953c04
commit f136728d78

View file

@ -32,7 +32,9 @@ void parse_worker(struct Args *args, char *arg_position,
} }
return; return;
} else if (isspace(line[0])) { } else if (isspace(line[0])) {
if (arg_length != 0) {
add_arg(args, arg_position, arg_length); add_arg(args, arg_position, arg_length);
}
while (line[0] != '\n' && isspace(line[0])) { while (line[0] != '\n' && isspace(line[0])) {
line++; line++;
} }