Merge pull request #27398 from yuwata/udev-rule-negative-match

udev-rule: fix negative match
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-04-26 16:40:01 +02:00
committed by GitHub
3 changed files with 19 additions and 11 deletions
+2 -2
View File
@@ -1896,7 +1896,7 @@ static int udev_rule_apply_token_to_event(
const char *val;
FOREACH_DEVICE_DEVLINK(dev, val)
if (token_match_string(token, strempty(startswith(val, "/dev/"))))
if (token_match_string(token, strempty(startswith(val, "/dev/"))) == (token->op == OP_MATCH))
return token->op == OP_MATCH;
return token->op == OP_NOMATCH;
}
@@ -1926,7 +1926,7 @@ static int udev_rule_apply_token_to_event(
const char *val;
FOREACH_DEVICE_CURRENT_TAG(dev, val)
if (token_match_string(token, val))
if (token_match_string(token, val) == (token->op == OP_MATCH))
return token->op == OP_MATCH;
return token->op == OP_NOMATCH;
}