When a rules contains several LABEL tokens, the parser used to silently
discard all of them besides the last one without any diagnostics at all.
It's time to break the vow of silence and let the parser issue a warning.
return log_token_invalid_attr(rules, key);
if (op != OP_ASSIGN)
return log_token_invalid_op(rules, key);
+ if (FLAGS_SET(rule_line->type, LINE_HAS_LABEL))
+ log_token_warning(rules, "Contains multiple LABEL keys, ignoring LABEL=\"%s\".",
+ rule_line->label);
rule_line->label = value;
SET_FLAG(rule_line->type, LINE_HAS_LABEL, true);
EOF
assert_1 "${rules}"
+cat >"${rules}" <<'EOF'
+GOTO="a"
+LABEL="a", LABEL="b"
+EOF
+cat >"${exp}" <<EOF
+${rules}:2 Contains multiple LABEL keys, ignoring LABEL="a".
+${rules}:1 GOTO="a" has no matching label, ignoring
+${rules}:1 The line takes no effect any more, dropping
+${rules}:2 LABEL="b" is unused.
+${rules}: udev rules check failed
+EOF
+assert_1 "${rules}"
+
# udevadm verify --root
sed "s|sample-[0-9]*.rules|${workdir}/${rules_dir}/&|" sample-*.exp >"${workdir}/${exp}"
cd -