Merge pull request #16435 from gaoyi1988/master
fix multi matches when use "||"
This commit is contained in:
commit
5553041a62
|
@ -452,6 +452,11 @@ static int rule_line_add_token(UdevRuleLine *rule_line, UdevRuleTokenType type,
|
|||
}
|
||||
}
|
||||
*b = '\0';
|
||||
|
||||
/* Make sure the value is end, so NULSTR_FOREACH can read correct match */
|
||||
if (b < a)
|
||||
b[1] = '\0';
|
||||
|
||||
if (bar)
|
||||
empty = true;
|
||||
|
||||
|
|
|
@ -1322,6 +1322,17 @@ EOF
|
|||
KERNEL=="sda", TAG=""
|
||||
TAGS=="foo|", SYMLINK+="found"
|
||||
TAGS=="aaa|bbb", SYMLINK+="bad"
|
||||
EOF
|
||||
},
|
||||
{
|
||||
desc => "test multi matches 11",
|
||||
devpath => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
|
||||
exp_name => "found",
|
||||
not_exp_name => "bad",
|
||||
rules => <<EOF
|
||||
KERNEL=="sda", TAG="c"
|
||||
TAGS=="foo||bar||c", SYMLINK+="found"
|
||||
TAGS=="aaa||bbb||ccc", SYMLINK+="bad"
|
||||
EOF
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue