From 38b9855bfa28d1a7c8e0a629187147d79ffdaf6b Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 15 Apr 2015 08:20:22 -0400 Subject: udev-builtin-usb_id: fix inverted condition Fix for 4beac74e69. Thanks, Ronny! --- src/udev/udev-builtin-usb_id.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c index 9418a6b850..462efc5c86 100644 --- a/src/udev/udev-builtin-usb_id.c +++ b/src/udev/udev-builtin-usb_id.c @@ -430,10 +430,10 @@ fallback: s = serial; l = strpcpyl(&s, sizeof(serial), vendor_str, "_", model_str, NULL); - if (isempty(serial_str)) + if (!isempty(serial_str)) l = strpcpyl(&s, l, "_", serial_str, NULL); - if (isempty(instance_str)) + if (!isempty(instance_str)) strpcpyl(&s, l, "-", instance_str, NULL); udev_builtin_add_property(dev, test, "ID_VENDOR", vendor_str); @@ -444,14 +444,14 @@ fallback: udev_builtin_add_property(dev, test, "ID_MODEL_ID", product_id); udev_builtin_add_property(dev, test, "ID_REVISION", revision_str); udev_builtin_add_property(dev, test, "ID_SERIAL", serial); - if (isempty(serial_str)) + if (!isempty(serial_str)) udev_builtin_add_property(dev, test, "ID_SERIAL_SHORT", serial_str); - if (isempty(type_str)) + if (!isempty(type_str)) udev_builtin_add_property(dev, test, "ID_TYPE", type_str); - if (isempty(instance_str)) + if (!isempty(instance_str)) udev_builtin_add_property(dev, test, "ID_INSTANCE", instance_str); udev_builtin_add_property(dev, test, "ID_BUS", "usb"); - if (isempty(packed_if_str)) + if (!isempty(packed_if_str)) udev_builtin_add_property(dev, test, "ID_USB_INTERFACES", packed_if_str); if (ifnum != NULL) udev_builtin_add_property(dev, test, "ID_USB_INTERFACE_NUM", ifnum); -- cgit v1.2.3-54-g00ecf