summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorThomas de Grenier de Latour <tom.gl@free.fr>2009-12-30 16:21:59 +0100
committerKay Sievers <kay.sievers@vrfy.org>2009-12-30 16:21:59 +0100
commit9bdcffd738f9170bda7a962affcf5d42381748e0 (patch)
treeb4eaf66070070bc9df8621a12eb184b800477046 /libudev
parent1f819a177630863aca7bf651dc429aa4eb3ba3af (diff)
libudev: enumerate - fix move_later logic
The move_later_prefix variable was reset to zero on each loop iteration, and thus the move_later entry (if any) was not added right after changing to another syspath prefix, but rather after exiting the enumeration loop.
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-enumerate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c
index 53cd53b694..9a61a61f0d 100644
--- a/libudev/libudev-enumerate.c
+++ b/libudev/libudev-enumerate.c
@@ -251,6 +251,7 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude
unsigned int i;
unsigned int max;
struct syspath *prev = NULL, *move_later = NULL;
+ size_t move_later_prefix = 0;
udev_list_cleanup_entries(udev_enumerate->udev, &udev_enumerate->devices_list);
qsort(udev_enumerate->devices, udev_enumerate->devices_cur, sizeof(struct syspath), syspath_cmp);
@@ -258,7 +259,6 @@ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *ude
max = udev_enumerate->devices_cur;
for (i = 0; i < max; i++) {
struct syspath *entry = &udev_enumerate->devices[i];
- size_t move_later_prefix = 0;
/* skip duplicated entries */
if (prev != NULL &&