diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-29 22:22:12 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2008-10-29 22:22:12 +0100 |
commit | aeb53ca3d60057dfbb948b222046dcecfcc11ed9 (patch) | |
tree | 0fb3a1251bc45725ee41b1f3927b3d9f66f5e189 /udev/udev-rules.c | |
parent | 0bc74ea79f68a89c5ec4bf5676dede97626ceade (diff) |
ATTR{}== always fails if the attribute does not exist
Diffstat (limited to 'udev/udev-rules.c')
-rw-r--r-- | udev/udev-rules.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 665ad71e80..f6cc45ba75 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -1808,11 +1808,10 @@ static int match_attr(struct udev_rules *rules, struct udev_device *dev, struct const char *val; val = udev_device_get_sysattr_value(dev, key_name); - if (val != NULL) - util_strlcpy(value, val, sizeof(value)); + if (val == NULL) + return -1; + util_strlcpy(value, val, sizeof(value)); } - if (value[0] == '\0') - return -1; /* strip trailing whitespace of value, if not asked to match for it */ len = strlen(key_value); |