]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix compile error, add number-up checks.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 27 Apr 2021 20:28:11 +0000 (16:28 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Tue, 27 Apr 2021 20:28:11 +0000 (16:28 -0400)
cups/ppd-cache.c

index 343a39353d8d5680a1bb66acb7cfe88c79398a6c..2e19acdc60652fbc6c2a814e52e4428f1aad67d8 100644 (file)
@@ -369,7 +369,7 @@ _cupsConvertOptions(
   * Map finishing options...
   */
 
-  if (copies != finishing_copies)
+  if (copies != finishings_copies)
   {
     // Figure out the proper job-pages-per-set value...
     if ((value = cupsGetOption("job-pages", num_options, options)) == NULL)
@@ -378,10 +378,16 @@ _cupsConvertOptions(
     if (value)
       job_pages = atoi(value);
 
+    // Adjust for number-up
+    if ((value = cupsGetOption("number-up", num_options, options)) != NULL)
+      number_up = atoi(value);
+
+    job_pages = (job_pages + number_up - 1) / number_up;
+
     // When duplex printing, raster data will include an extra (blank) page to
     // make the total number of pages even.  Make sure this is reflected in the
     // page count...
-    if ((job_pages & 1) && (keyword = cupsGetOption("sides", num_options, options)) != NULL && strcmp(sides, "one-sided"))
+    if ((job_pages & 1) && (keyword = cupsGetOption("sides", num_options, options)) != NULL && strcmp(keyword, "one-sided"))
       job_pages ++;
   }