diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c index 186ec8ad..3a2d47cc 100644 --- a/libwacom/libwacom-database.c +++ b/libwacom/libwacom-database.c @@ -155,11 +155,12 @@ bus_to_str (WacomBusType bus) char * make_match_string (const char *name, const char *uniq, WacomBusType bus, int vendor_id, int product_id) { - return g_strdup_printf("%s|%04x|%04x%s%s%s%s", + return g_strdup_printf("%s|%04x|%04x%s%s%s%s%s", bus_to_str (bus), vendor_id, product_id, name ? "|" : "", name ? name : "", + !name && uniq ? "|" : "", uniq ? "|" : "", uniq ? uniq : ""); } diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c index 0d44c947..2d63708b 100644 --- a/libwacom/libwacom.c +++ b/libwacom/libwacom.c @@ -633,6 +633,10 @@ libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFal if (device == NULL) { match_name = NULL; device = libwacom_new (db, match_name, match_uniq, vendor_id, product_id, bus, error); + if (device == NULL) { + match_uniq = uniq; + device = libwacom_new (db, match_name, match_uniq, vendor_id, product_id, bus, error); + } } }