diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-11-14 13:00:12 -0500 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-11-14 13:00:12 -0500 |
commit | 3ff5a8e3932907c5794165b27ecefa1e8d7b1321 (patch) | |
tree | 99353b5756fb595b7ce940c7c4fcb7c518fdac26 | |
parent | bea505c32e49316ffca229107e8abf6fd9ea38dd (diff) | |
download | cups-3ff5a8e3932907c5794165b27ecefa1e8d7b1321.tar.gz |
Fix lpoptions defaults (Issue #5681)
-rw-r--r-- | CHANGES.md | 1 | ||||
-rw-r--r-- | cups/dest.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/CHANGES.md b/CHANGES.md index 779ac3321..e80ca4cc1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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". diff --git a/cups/dest.c b/cups/dest.c index 17d96fe4a..6ddfe9a36 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -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... */ |