From d2a43afce04943a40a43e8d6b57a069bcf5acb78 Mon Sep 17 00:00:00 2001 From: Rolf Bensch Date: Tue, 31 Mar 2020 13:26:38 +0200 Subject: [PATCH] pixma: get device id if we replay a xml file --- backend/pixma/pixma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/pixma/pixma.c b/backend/pixma/pixma.c index 422bb6730..aed9e7013 100644 --- a/backend/pixma/pixma.c +++ b/backend/pixma/pixma.c @@ -1626,7 +1626,11 @@ sane_open (SANE_String_Const name, SANE_Handle * h) nscanners = pixma_find_scanners (conf_devices, SANE_FALSE); if (nscanners == 0) return SANE_STATUS_INVAL; - if (name[0] == '\0') + + /* also get device id if we replay a xml file + * otherwise name contains the xml filename + * and further replay will fail */ + if (name[0] == '\0' || strstr (name, ".xml")) name = pixma_get_device_id (0); /* Have we already opened the scanner? */