summaryrefslogtreecommitdiff
path: root/backend/kvs20xx.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-05-24 21:03:56 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-05-24 21:03:56 +0200
commit58912f68c2489bcee787599837447e0d64dfd61a (patch)
treedda50aadde35fe152da1a8d50769987ace0f1496 /backend/kvs20xx.c
parentcfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff)
New upstream version 1.0.27upstream/1.0.27
Diffstat (limited to 'backend/kvs20xx.c')
-rw-r--r--backend/kvs20xx.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/kvs20xx.c b/backend/kvs20xx.c
index 955252a..8864d7d 100644
--- a/backend/kvs20xx.c
+++ b/backend/kvs20xx.c
@@ -156,7 +156,8 @@ sane_get_devices (const SANE_Device *** device_list,
known_devices[curr_scan_dev].scanner.model,
NULL, -1, -1, -1, -1, attach);
}
- *device_list = (const SANE_Device **) devlist;
+ if(device_list)
+ *device_list = (const SANE_Device **) devlist;
return SANE_STATUS_GOOD;
}
@@ -168,6 +169,12 @@ sane_open (SANE_String_Const devname, SANE_Handle * handle)
struct scanner *s;
SANE_Int h, bus;
SANE_Status st;
+ if (!devlist)
+ {
+ st = sane_get_devices (NULL, 0);
+ if (st)
+ return st;
+ }
for (i = 0; devlist[i]; i++)
{
if (!strcmp (devlist[i]->name, devname))