I know how to use loops, I swear!

SVN revision: 48860
This commit is contained in:
Mike Blumenkrantz 2010-05-14 07:47:37 +00:00
parent b79eccfc57
commit 019bb06085
1 changed files with 1 additions and 3 deletions

View File

@ -30,7 +30,7 @@ _walk_parents_for_attr(struct udev_device *device, const char *sysattr, const ch
struct udev_device *parent, *child = device;
const char *test;
while ((parent = udev_device_get_parent(child)))
for (parent = udev_device_get_parent(child); parent; child = parent, parent = udev_device_get_parent(child))
{
if (!(test = udev_device_get_sysattr_value(parent, sysattr)))
continue;
@ -38,8 +38,6 @@ _walk_parents_for_attr(struct udev_device *device, const char *sysattr, const ch
return 1;
else if (!strcmp(test, value))
return 1;
child = parent;
}
return 0;