File 0001-cups-dests.c-cupsGetNamedDest-set-IPP_STATUS_ERROR_N.patch of Package cups (Revision e195a46973c88410e29195b989f9c913)
Currently displaying revision e195a46973c88410e29195b989f9c913 , Show latest
66
1
From 4ddeb8544e2e5c63a405d9e093ac24704f3deb03 Mon Sep 17 00:00:00 2001
2
From: Zdenek Dohnal <zdohnal@redhat.com>
3
Date: Tue, 21 Jul 2020 12:54:22 +0200
4
Subject: [PATCH] cups/dests.c: cupsGetNamedDest() - set
5
IPP_STATUS_ERROR_NOT_FOUND error if queue was not found lp.c/lpr.c: check for
6
IPP_STATUS_ERROR_NOT_FOUND and generate a proper message if hit
7
8
---
9
berkeley/lpr.c | 6 ++++++
10
cups/dest.c | 3 +++
11
systemv/lp.c | 6 ++++++
12
3 files changed, 15 insertions(+)
13
14
diff --git a/berkeley/lpr.c b/berkeley/lpr.c
15
index 627fa6a4e..a8f78b881 100644
16
--- a/berkeley/lpr.c
17
+++ b/berkeley/lpr.c
18
19
_cupsLangPrintf(stderr, _("%s: Error - add '/version=1.1' to server name."), argv[0]);
20
return (1);
21
}
22
+ else if (cupsLastError() == IPP_STATUS_ERROR_NOT_FOUND)
23
+ {
24
+ _cupsLangPrintf(stderr,
25
+ _("%s: Error - The printer or class does not exist."), argv[0]);
26
+ return (1);
27
+ }
28
break;
29
30
case '#' : /* Number of copies */
31
diff --git a/cups/dest.c b/cups/dest.c
32
index cde987a09..2017792a7 100644
33
--- a/cups/dest.c
34
+++ b/cups/dest.c
35
36
cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_name_cb, &data);
37
38
if (!data.dest)
39
+ {
40
+ _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("The printer or class does not exist."), 1);
41
return (NULL);
42
+ }
43
44
dest = data.dest;
45
}
46
diff --git a/systemv/lp.c b/systemv/lp.c
47
index 298c15825..d918b4b14 100644
48
--- a/systemv/lp.c
49
+++ b/systemv/lp.c
50
51
"name."), argv[0]);
52
return (1);
53
}
54
+ else if (cupsLastError() == IPP_STATUS_ERROR_NOT_FOUND)
55
+ {
56
+ _cupsLangPrintf(stderr,
57
+ _("%s: Error - The printer or class does not exist."), argv[0]);
58
+ return (1);
59
+ }
60
break;
61
62
case 'f' : /* Form */
63
--
64
2.32.0
65
66