From edac5229aec2f3e95f4d9aa37de9e0b17803cd4a Mon Sep 17 00:00:00 2001 From: MIHIRA Sanpei Yoshiro Date: Sun, 18 Jan 2004 12:46:19 +0000 Subject: Empty vendor string overrides knowndevs ubd_devinfo_vp() is getting an empty string from its usbd_get_string() call on the vendor, instead of NULL. This means usb_knowndevs in not consulted. Add lines between grabbing those char *s and the USBVERBOSE ifdef to set vendor to NULL if it is the empty string (similarly for product). This causes vendor to be filled-out, although the product name read overrules usb_knowndevs (this appears to be a conscience decision made by the NetBSD folks): PR: kern/56097 Submitted by: Hal Burch MFC after: 1 week --- sys/dev/usb/usb_subr.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/dev') diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index ec88dc6a5a01..b73f20dba7a3 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -257,6 +257,10 @@ usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev) usbd_trim_spaces(vendor); product = usbd_get_string(dev, udd->iProduct, p); usbd_trim_spaces(product); + if (vendor && !*vendor) + vendor = NULL; + if (product && !*product) + product = NULL; } else { vendor = NULL; product = NULL; -- cgit v1.3