From: mike Date: Tue, 19 Mar 2013 18:10:04 +0000 (+0000) Subject: The scheduler incorrectly computed the final content type value when null X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bde80aee90e1bea0c3ed2858d2a9faee79dae9e6;p=thirdparty%2Fcups.git The scheduler incorrectly computed the final content type value when null filters were present. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10916 7a7537e8-13f0-0310-91df-b6672ffda945 --- diff --git a/CHANGES-1.6.txt b/CHANGES-1.6.txt index b44b09350b..9de6bdb22f 100644 --- a/CHANGES-1.6.txt +++ b/CHANGES-1.6.txt @@ -1,6 +1,12 @@ CHANGES-1.6.txt --------------- +CHANGES IN CUPS V1.6.3 + + - The scheduler incorrectly computed the final content type value when + null filters were present. + + CHANGES IN CUPS V1.6.2 - Documentation fixes (STR #4229, STR #4239, STR #4234, STR #4248, diff --git a/scheduler/job.c b/scheduler/job.c index 85e0756486..cce4b3969d 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -560,7 +560,7 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ /* CONTENT_TYPE env variable */ device_uri[1024], /* DEVICE_URI env variable */ - final_content_type[1024], + final_content_type[1024] = "", /* FINAL_CONTENT_TYPE env variable */ lang[255], /* LANG env variable */ #ifdef __APPLE__ @@ -598,7 +598,6 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ memset(job->filters, 0, sizeof(job->filters)); - if (job->printer->raw) { /* @@ -636,6 +635,23 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ goto abort_job; } + /* SET FINAL_CONTENT_TYPE HERE */ + if (!job->printer->remote) + { + filter = (mime_filter_t *)cupsArrayLast(filters); + + if (filter && filter->dst) + { + if ((ptr = strchr(filter->dst->type, '/')) != NULL) + snprintf(final_content_type, sizeof(final_content_type), + "FINAL_CONTENT_TYPE=%s", ptr + 1); + else + snprintf(final_content_type, sizeof(final_content_type), + "FINAL_CONTENT_TYPE=%s/%s", filter->dst->super, + filter->dst->type); + } + } + /* * Remove NULL ("-") filters... */ @@ -1034,25 +1050,8 @@ cupsdContinueJob(cupsd_job_t *job) /* I - Job */ envp[envc ++] = banner_page ? "CUPS_FILETYPE=job-sheet" : "CUPS_FILETYPE=document"; - if (!job->printer->remote && !job->printer->raw) - { - filter = (mime_filter_t *)cupsArrayLast(filters); - - if (job->printer->port_monitor) - filter = (mime_filter_t *)cupsArrayPrev(filters); - - if (filter && filter->dst) - { - if ((ptr = strchr(filter->dst->type, '/')) != NULL) - snprintf(final_content_type, sizeof(final_content_type), - "FINAL_CONTENT_TYPE=%s", ptr + 1); - else - snprintf(final_content_type, sizeof(final_content_type), - "FINAL_CONTENT_TYPE=%s/%s", filter->dst->super, - filter->dst->type); - envp[envc ++] = final_content_type; - } - } + if (final_content_type[0]) + envp[envc ++] = final_content_type; if (Classification && !banner_page) {