If hubs are chained to other hubs there will be multiple '.' characters, and
want the last one.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
}
parent_sysfs_dir = strdup(sysfs_dir);
- if (NULL != (tmp = strchr(parent_sysfs_dir, '.')) ||
- NULL != (tmp = strchr(parent_sysfs_dir, '-'))) {
+ if (NULL != (tmp = strrchr(parent_sysfs_dir, '.')) ||
+ NULL != (tmp = strrchr(parent_sysfs_dir, '-'))) {
*tmp = '\0';
} else {
free (parent_sysfs_dir);
-#define LIBUSB_NANO 10674
+#define LIBUSB_NANO 10675