From 0d3db9bca01d4b19253a7196fc2cb41f66d17f88 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Sat, 27 Aug 2022 22:53:45 +0200 Subject: [PATCH] libppd: In ppdFilterLoadPPD() correct check for final output type To determine whether the PDF filter (usually cfFilterPDFToPDF()) has to do the page logging for CUPS ("PAGE: XX YY" log messages) or the driver filter, we check the final output type (FINAL_CONTENT_TYPE environment cariable from CUPS) to see whether a driver filter is involved which should log the pages by itself. The code to compare the final output type with the "*cupsFilter(2): ..." lines in the PPD file was broken, which is fixed with this commit. --- ppd/ppd-filter.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ppd/ppd-filter.c b/ppd/ppd-filter.c index a53af8f8f..06a830998 100644 --- a/ppd/ppd-filter.c +++ b/ppd/ppd-filter.c @@ -832,8 +832,10 @@ ppdFilterLoadPPD(cf_filter_data_t *data) /* I/O - Job and printer data */ while (!isspace(*p)) p ++; while (isspace(*p)) p ++; } - if (!strncasecmp(data->final_content_type, p, - strlen(data->final_content_type))) { + if (strlen(p) >= strlen(data->final_content_type) && + !strncasecmp(data->final_content_type, p, + strlen(data->final_content_type)) && + !isalnum(p[strlen(data->final_content_type)])) { break; } } -- 2.47.3