]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Allow PPD choices and PWG keywords to select media (Issue #238)
authorMichael R Sweet <msweet@msweet.org>
Fri, 5 Apr 2024 12:46:37 +0000 (08:46 -0400)
committerMichael R Sweet <msweet@msweet.org>
Fri, 5 Apr 2024 12:46:37 +0000 (08:46 -0400)
CHANGES.md
cups/ppd-cache.c

index 12ac4f1aee003fe853cdfcdd2f03e8812d346cde..54ea977a5d61ee4a21da3fbf75f62101a6a422a7 100644 (file)
@@ -36,6 +36,7 @@ Changes in CUPS v2.5b1 (TBA)
 - Fixed use-after-free in `cupsdAcceptClient()` when we log warning during error
   handling (fixes CVE-2023-34241)
 - Fixed hanging of `lpstat` on Solaris (Issue #156)
+- Fixed mapping of PPD InputSlot, MediaType, and OutputBin values (Issue #238)
 - Fixed Digest authentication support (Issue #260)
 - Fixed the web interface not showing an error for a non-existent printer
   (Issue #423)
index 8be335b0847683be8e93960b6587b84107a3eb45..c39fa45961f0e451f8d54f7793660474fe0b7700 100644 (file)
@@ -2336,7 +2336,7 @@ ppd_inputslot_for_keyword(
     return (NULL);
 
   for (i = 0; i < pc->num_sources; i ++)
-    if (!_cups_strcasecmp(keyword, pc->sources[i].pwg))
+    if (!_cups_strcasecmp(keyword, pc->sources[i].pwg) || !_cups_strcasecmp(keyword, pc->sources[i].ppd))
       return (pc->sources[i].ppd);
 
   return (NULL);
@@ -2451,7 +2451,7 @@ _ppdCacheGetMediaType(
     int        i;                              /* Looping var */
 
     for (i = 0; i < pc->num_types; i ++)
-      if (!_cups_strcasecmp(keyword, pc->types[i].pwg))
+      if (!_cups_strcasecmp(keyword, pc->types[i].pwg) || !_cups_strcasecmp(keyword, pc->types[i].ppd))
         return (pc->types[i].ppd);
   }
 
@@ -2485,7 +2485,7 @@ _ppdCacheGetOutputBin(
 
 
   for (i = 0; i < pc->num_bins; i ++)
-    if (!_cups_strcasecmp(output_bin, pc->bins[i].pwg))
+    if (!_cups_strcasecmp(output_bin, pc->bins[i].pwg) || !_cups_strcasecmp(output_bin, pc->bins[i].ppd))
       return (pc->bins[i].ppd);
 
   return (NULL);