]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Support bare staple and bind finishings values 1094/head
authorBenjamin Gordon <bmgordon@chromium.org>
Fri, 1 Nov 2024 19:51:42 +0000 (13:51 -0600)
committerBenjamin Gordon <bmgordon@chromium.org>
Fri, 1 Nov 2024 21:53:45 +0000 (15:53 -0600)
In the generated PPD, IPP finishings "bind" is supposed to map to
"StapleLocation: BindAuto".  Similarly, "staple" is supposed to map to
"StapleLocation: SingleAuto".  The code already handles this, except
the lookup is blocked by a check that only accepts "staple-*" and
"bind-*" prefixed versions.  Fix this by adding the bare versions to the
existing checks.

Fixes issue #1073.

CHANGES.md
cups/ppd-cache.c

index b2a70d176a33881af02e5693c45c44cd1b2b6cc7..736353fca81cabd3a00b5900498f27ee3200213f 100644 (file)
@@ -89,6 +89,8 @@ Changes in CUPS v2.5b1 (TBA)
 - Fixed memory leak when unloading a job (Issue #813)
 - Fixed memory leak when creating color profiles (Issue #814)
 - Fixed punch finisher support for IPP Everywhere printers (Issue #821)
+- Fixed staple and bind finisher support for IPP Everywhere printers
+  (Issue #1073)
 - Fixed crash in `scan_ps()` if incoming argument is NULL (Issue #831)
 - Fixed setting job state reasons for successful jobs (Issue #832)
 - Fixed infinite loop in IPP backend if hostname is IP address with Kerberos
index 90784aa7bc6d668ae85c6c15d497417cd4aa0246..65dcbbc3967b8da163c7c951e86c6ad9a7f250ec 100644 (file)
@@ -4550,7 +4550,7 @@ _ppdCreateFromIPP(char   *buffer, /* I - Filename buffer */
       value   = ippGetInteger(attr, i);
       keyword = ippEnumString("finishings", value);
 
-      if (!strncmp(keyword, "staple-", 7) || !strncmp(keyword, "bind-", 5) || !strncmp(keyword, "edge-stitch-", 12) || !strcmp(keyword, "saddle-stitch"))
+      if (!strncmp(keyword, "staple-", 7) || !strncmp(keyword, "bind-", 5) || !strncmp(keyword, "edge-stitch-", 12) || !strcmp(keyword, "saddle-stitch") || !strcmp(keyword, "staple") || !strcmp(keyword, "bind"))
         break;
     }
 
@@ -4597,7 +4597,7 @@ _ppdCreateFromIPP(char   *buffer, /* I - Filename buffer */
         value   = ippGetInteger(attr, i);
         keyword = ippEnumString("finishings", value);
 
-        if (strncmp(keyword, "staple-", 7) && strncmp(keyword, "bind-", 5) && strncmp(keyword, "edge-stitch-", 12) && strcmp(keyword, "saddle-stitch"))
+        if (strncmp(keyword, "staple-", 7) && strncmp(keyword, "bind-", 5) && strncmp(keyword, "edge-stitch-", 12) && strcmp(keyword, "saddle-stitch") && strcmp(keyword, "staple") && strcmp(keyword, "bind"))
           continue;
 
         if (cupsArrayFind(names, (char *)keyword))
@@ -4988,7 +4988,7 @@ _ppdCreateFromIPP(char   *buffer, /* I - Filename buffer */
              option = "FoldType";
            else if (!strncmp(keyword, "punch-", 6))
              option = "PunchMedia";
-           else if (!strncmp(keyword, "bind-", 5) || !strncmp(keyword, "edge-stitch-", 12) || !strcmp(keyword, "saddle-stitch") || !strncmp(keyword, "staple-", 7))
+           else if (!strncmp(keyword, "bind-", 5) || !strncmp(keyword, "edge-stitch-", 12) || !strcmp(keyword, "saddle-stitch") || !strncmp(keyword, "staple-", 7) || !strcmp(keyword, "staple") || !strcmp(keyword, "bind"))
              option = "StapleLocation";
 
            if (option && keyword)