From 8f6a4fb46c5f9b2d25fb169fbab8406cfc0a15dd Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Wed, 9 May 2007 21:24:17 +0000 Subject: [PATCH] Fix for devices without vendor or product name --- src/conf.c | 10 ++++------ src/hal.c | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conf.c b/src/conf.c index e8b0aa1..8775809 100644 --- a/src/conf.c +++ b/src/conf.c @@ -107,12 +107,10 @@ static int pusb_conf_device_get_property(t_pusb_options *opts, static int pusb_conf_parse_device(t_pusb_options *opts, xmlDoc *doc) { - if (!pusb_conf_device_get_property(opts, doc, "vendor", opts->device.vendor, - sizeof(opts->device.vendor))) - return (0); - if (!pusb_conf_device_get_property(opts, doc, "model", opts->device.model, - sizeof(opts->device.model))) - return (0); + pusb_conf_device_get_property(opts, doc, "vendor", opts->device.vendor, + sizeof(opts->device.vendor)); + pusb_conf_device_get_property(opts, doc, "model", opts->device.model, + sizeof(opts->device.model)); if (!pusb_conf_device_get_property(opts, doc, "serial", opts->device.serial, sizeof(opts->device.serial))) return (0); diff --git a/src/hal.c b/src/hal.c index c19c351..793fe7f 100644 --- a/src/hal.c +++ b/src/hal.c @@ -161,7 +161,7 @@ char *pusb_hal_find_item(LibHalContext *ctx, for (i = 0; i < n_devices; ++i) { char *key = NULL; - int match = 1; + int match = 1; va_start(ap, value); while ((key = va_arg(ap, char *))) @@ -169,6 +169,8 @@ char *pusb_hal_find_item(LibHalContext *ctx, char *value = NULL; value = va_arg(ap, char *); + if (!value || *value == 0x0) + continue ; if (!pusb_hal_check_property(ctx, devices[i], key, value)) {