summaryrefslogtreecommitdiff
path: root/systemv
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-12-06 11:24:11 -0500
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-12-06 11:24:11 -0500
commitdf4101bff6f03d551bf6ec81082f8878d2bcc85a (patch)
tree445bc3f49dbafc653752265ec83cc8b53177396b /systemv
parent7d730d0ce72263e1b53e97bce4e45d08be21e564 (diff)
downloadcups-df4101bff6f03d551bf6ec81082f8878d2bcc85a.tar.gz
lpoptions now works with discovered but un-added printers (Issue #5045)
Diffstat (limited to 'systemv')
-rw-r--r--systemv/lpoptions.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/systemv/lpoptions.c b/systemv/lpoptions.c
index f80319a19..0712c908d 100644
--- a/systemv/lpoptions.c
+++ b/systemv/lpoptions.c
@@ -1,10 +1,11 @@
/*
* Printer option program for CUPS.
*
- * Copyright 2007-2016 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
*
- * Licensed under Apache License v2.0. See the file "LICENSE" for more information.
+ * Licensed under Apache License v2.0. See the file "LICENSE" for more
+ * information.
*/
/*
@@ -476,19 +477,32 @@ list_group(ppd_file_t *ppd, /* I - PPD file */
static void
list_options(cups_dest_t *dest) /* I - Destination to list */
{
+ http_t *http; /* Connection to destination */
+ char resource[1024]; /* Resource path */
int i; /* Looping var */
const char *filename; /* PPD filename */
ppd_file_t *ppd; /* PPD data */
ppd_group_t *group; /* Current group */
- if ((filename = cupsGetPPD(dest->name)) == NULL)
+ if ((http = cupsConnectDest(dest, CUPS_DEST_FLAGS_NONE, 30000, NULL, resource, sizeof(resource), NULL, NULL)) == NULL)
{
_cupsLangPrintf(stderr, _("lpoptions: Unable to get PPD file for %s: %s"),
dest->name, cupsLastErrorString());
return;
}
+ if ((filename = cupsGetPPD2(http, dest->name)) == NULL)
+ {
+ httpClose(http);
+
+ _cupsLangPrintf(stderr, _("lpoptions: Unable to get PPD file for %s: %s"),
+ dest->name, cupsLastErrorString());
+ return;
+ }
+
+ httpClose(http);
+
if ((ppd = ppdOpenFile(filename)) == NULL)
{
unlink(filename);