]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler incorrectly computed the final content type value when null
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 19 Mar 2013 18:10:04 +0000 (18:10 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 19 Mar 2013 18:10:04 +0000 (18:10 +0000)
filters were present.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10916 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.6.txt
scheduler/job.c

index b44b09350be9c1296a441a1bfc2069ab03ff1c07..9de6bdb22f2e565bdedb6a19b85b39d803bd1b87 100644 (file)
@@ -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,
index 85e0756486855c9773e13746803771753ae079e2..cce4b3969d0d11f82712b773b558c8cdbbbe4a61 100644 (file)
@@ -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)
   {