fix(parse): guard not to add empty arg
This commit is contained in:
parent
e5aa953c04
commit
f136728d78
1 changed files with 3 additions and 1 deletions
|
@ -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])) {
|
||||||
add_arg(args, arg_position, arg_length);
|
if (arg_length != 0) {
|
||||||
|
add_arg(args, arg_position, arg_length);
|
||||||
|
}
|
||||||
while (line[0] != '\n' && isspace(line[0])) {
|
while (line[0] != '\n' && isspace(line[0])) {
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue