From aa91508356f243edc3b11795b1481edcfe0d39c2 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 24 Mar 2010 23:18:35 -0700 Subject: [PATCH] config/udev: Prefer product name from attribute rather than uevent The input device product name for evdev devices in the kernel uevent has embedded quotes that aren't expected here. Use the sysfs name attribute instead, which does not suffer this problem. The uevent name will be used as a fallback if no name attribute is found. Signed-off-by: Dan Nicholson Signed-off-by: Peter Hutterer --- config/udev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/udev.c b/config/udev.c index 69257e935..452fb5a8d 100644 --- a/config/udev.c +++ b/config/udev.c @@ -73,8 +73,11 @@ device_added(struct udev_device *udev_device) goto unwind; parent = udev_device_get_parent(udev_device); - if (parent) - name = udev_device_get_property_value(parent, "NAME"); + if (parent) { + name = udev_device_get_sysattr_value(parent, "name"); + if (!name) + name = udev_device_get_property_value(parent, "NAME"); + } if (!name) name = "(unnamed)"; else