]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix lpoptions defaults (Issue #5681)
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 14 Nov 2019 19:21:39 +0000 (14:21 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 14 Nov 2019 19:21:39 +0000 (14:21 -0500)
CHANGES.md
cups/dest.c

index 0c9b7df239ff44ab6ce26c315101e53b5244962f..2d7a874b436d84049f2488c39ed8107dd24a2c16 100644 (file)
@@ -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)
 
index fd635b1111b6b0eeb077b306832c723bd240a3f9..9a890dfca36539135b254551e1ca0df7ae085680 100644 (file)
@@ -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...
   */