mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 02:48:38 +00:00
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:
parent
4012754569
commit
8da530475d
@ -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;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user