modprobe: fix parsing of short lines.
The intent here seems to have been to ignore lines with too few arguments to be valid, but since strtok() returns NULL at the end of the string, if you only have "verb noun", you'd be falsely rejected. Since we've kept a count anyway, just check the count.
This commit is contained in:
parent
d02da4ec60
commit
0842ada4d6
@ -238,7 +238,8 @@ static int config_action(struct dirtree *node)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!tk) continue;
|
||||
// Every command requires at least one argument.
|
||||
if (tcount < 2) continue;
|
||||
// process the tokens[0] contains first word of config line.
|
||||
if (!strcmp(tokens[0], "alias")) {
|
||||
struct arg_list *temp;
|
||||
|
Loading…
Reference in New Issue
Block a user