udev: rename field

When we start, the contents of the variable match the name. But then
in the loop, the variable doesn't point at the old head any more. So let's
rename it to something with a plural.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-06-29 14:25:11 +02:00
parent ed828563a5
commit d5fe7f7fb1

View File

@ -1056,21 +1056,19 @@ static int parse_line(char **line, char **ret_key, char **ret_attr, UdevRuleOper
}
static void sort_tokens(UdevRuleLine *rule_line) {
UdevRuleToken *head_old;
assert(rule_line);
head_old = TAKE_PTR(rule_line->tokens);
UdevRuleToken *old_tokens = TAKE_PTR(rule_line->tokens);
rule_line->current_token = NULL;
while (head_old) {
while (old_tokens) {
UdevRuleToken *min_token = NULL;
LIST_FOREACH(tokens, t, head_old)
LIST_FOREACH(tokens, t, old_tokens)
if (!min_token || min_token->type > t->type)
min_token = t;
LIST_REMOVE(tokens, head_old, min_token);
LIST_REMOVE(tokens, old_tokens, min_token);
rule_line_append_token(rule_line, min_token);
}
}