aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-base.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-plugin-base.c')
-rw-r--r--src/mm-plugin-base.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-plugin-base.c b/src/mm-plugin-base.c
index b34ec50a..fe239363 100644
--- a/src/mm-plugin-base.c
+++ b/src/mm-plugin-base.c
@@ -922,7 +922,11 @@ mm_plugin_base_get_device_ids (MMPluginBase *self,
}
vid = g_udev_device_get_property (device, "ID_VENDOR_ID");
- if (!vid || (strlen (vid) != 4))
+ if (!vid)
+ goto out;
+ if (strncmp (vid, "0x", 2) == 0)
+ vid += 2;
+ if (strlen (vid) != 4)
goto out;
if (vendor) {
@@ -931,7 +935,13 @@ mm_plugin_base_get_device_ids (MMPluginBase *self,
}
pid = g_udev_device_get_property (device, "ID_MODEL_ID");
- if (!pid || (strlen (pid) != 4)) {
+ if (!pid) {
+ *vendor = 0;
+ goto out;
+ }
+ if (strncmp (pid, "0x", 2) == 0)
+ pid += 2;
+ if (strlen (pid) != 4) {
*vendor = 0;
goto out;
}