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.
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);
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 &&