Browse Source

Fix for devices without vendor or product name

Andrea Luzzardi 17 years ago
parent
commit
8f6a4fb46c
2 changed files with 7 additions and 7 deletions
  1. +4
    -6
      src/conf.c
  2. +3
    -1
      src/hal.c

+ 4
- 6
src/conf.c View File

@ -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) 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, if (!pusb_conf_device_get_property(opts, doc, "serial", opts->device.serial,
sizeof(opts->device.serial))) sizeof(opts->device.serial)))
return (0); return (0);


+ 3
- 1
src/hal.c View File

@ -161,7 +161,7 @@ char *pusb_hal_find_item(LibHalContext *ctx,
for (i = 0; i < n_devices; ++i) for (i = 0; i < n_devices; ++i)
{ {
char *key = NULL; char *key = NULL;
int match = 1;
int match = 1;
va_start(ap, value); va_start(ap, value);
while ((key = va_arg(ap, char *))) while ((key = va_arg(ap, char *)))
@ -169,6 +169,8 @@ char *pusb_hal_find_item(LibHalContext *ctx,
char *value = NULL; char *value = NULL;
value = va_arg(ap, char *); value = va_arg(ap, char *);
if (!value || *value == 0x0)
continue ;
if (!pusb_hal_check_property(ctx, devices[i], if (!pusb_hal_check_property(ctx, devices[i],
key, value)) key, value))
{ {


Loading…
Cancel
Save