From: Michael R Sweet Date: Thu, 14 Nov 2019 19:21:39 +0000 (-0500) Subject: Fix lpoptions defaults (Issue #5681) X-Git-Tag: v2.2.13~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9645531eebcf5dc0784791eb53e052b3aa132a3e;p=thirdparty%2Fcups.git Fix lpoptions defaults (Issue #5681) --- diff --git a/CHANGES.md b/CHANGES.md index 0c9b7df239..2d7a874b43 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -CHANGES - 2.2.13 - 2019-10-07 +CHANGES - 2.2.13 - 2019-11-14 ============================= @@ -10,6 +10,7 @@ Changes in CUPS v2.2.13 - Fixed the default common name for TLS certificates used by `ippserver`. - The libusb-based USB backend now reports an error when the distribution permissions are wrong (Issue #5658) +- Default printers set with `lpoptions` did not work in all cases (Issue #5681) - The IPP backend did not detect all cases where a job should be retried using a raster format (rdar://56021091) diff --git a/cups/dest.c b/cups/dest.c index fd635b1111..9a890dfca3 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -3486,6 +3486,16 @@ cups_enum_dests( data.num_dests = cups_get_dests(filename, NULL, NULL, 1, user_default != NULL, data.num_dests, &data.dests); } + if (!data.def_name[0] && (user_dest = cupsGetDest(NULL, NULL, data.num_dests, data.dests)) != NULL) + { + /* + * Use an lpoptions default printer... + */ + + strlcpy(data.def_name, user_dest->name, sizeof(data.def_name)); + data.def_instance = user_dest->instance; + } + /* * Get ready to enumerate... */