trivial: Fix deduplication when looking for the old device ID

When searching for a device by id, also include the old device in the search.
This commit is contained in:
Richard Hughes 2018-01-12 20:30:43 +00:00
parent 4012754569
commit 8da530475d

View File

@ -203,6 +203,22 @@ fu_device_list_find_by_id (FuDeviceList *self,
}
}
}
for (guint i = 0; i < self->devices->len; i++) {
FuDeviceItem *item_tmp = g_ptr_array_index (self->devices, i);
const gchar *ids[] = {
fu_device_get_id (item_tmp->device),
fu_device_get_equivalent_id (item_tmp->device),
NULL };
if (item_tmp->device_old == NULL)
continue;
for (guint j = 0; ids[j] != NULL; j++) {
if (strncmp (ids[j], device_id, device_id_len) == 0) {
if (item != NULL && multiple_matches != NULL)
*multiple_matches = TRUE;
item = item_tmp;
}
}
}
return item;
}