From 3ff5a8e3932907c5794165b27ecefa1e8d7b1321 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 14 Nov 2019 13:00:12 -0500 Subject: Fix lpoptions defaults (Issue #5681) --- cups/dest.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cups') 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... */ -- cgit v1.2.1