From: Michael R Sweet Date: Tue, 27 Apr 2021 20:28:11 +0000 (-0400) Subject: Fix compile error, add number-up checks. X-Git-Tag: v2.4b1~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8edf32fac9f7741d0ff6e287e4d81ec7376e4a04;p=thirdparty%2Fcups.git Fix compile error, add number-up checks. --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 343a39353d..2e19acdc60 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -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 ++; }