]> 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 18:00:12 +0000 (13:00 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 14 Nov 2019 18:00:12 +0000 (13:00 -0500)
CHANGES.md
cups/dest.c

index 779ac3321bede615d1036de290db1da874e12dee..e80ca4cc11cd23c0dd52a7305f17ca3c79ad830b 100644 (file)
@@ -17,6 +17,7 @@ Changes in CUPS v2.3.1
 - Added paint can labels to Dymo driver (Issue #5662)
 - The `--with-dbusdir` option was ignored by the configure script (Issue #5671)
 - Log file access controls were not preserved by `cupsctl` (Issue #5677)
+- 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)
 - Fixed spelling of "fold-accordion".
index 17d96fe4a779425cfffa6f8daa622b1bfd1e8af5..6ddfe9a36d64acd4520865e884e17f2d64b6f258 100644 (file)
@@ -3482,6 +3482,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...
   */