]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The cupsfilter utility did not set the CONTENT_TYPE environment variable.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 7 Nov 2008 00:58:34 +0000 (00:58 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 7 Nov 2008 00:58:34 +0000 (00:58 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@8105 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES.txt
scheduler/cupsfilter.c

index d6d77be22cbd5e9b6f75003b61c2cd3c3a2e2875..c02157b472c1489eaea8dc0d01b9b53c9e04bd4d 100644 (file)
@@ -1,8 +1,10 @@
-CHANGES.txt - 2008-10-31
+CHANGES.txt - 2008-11-06
 ------------------------
 
 CHANGES IN CUPS V1.4b2
 
+       - The cupsfilter utility did not set the CONTENT_TYPE environment
+         variable when running filters.
        - The scheduler now waits to allow system sleep until the jobs
          have all stopped.
        - The IPP, LPD, and socket backends used different "connecting"
index 518dd553d7d6d1601bbd17c654b569efd6ad1e50..aed476bbfba90b6a865cc683509f69c80dcee8db 100644 (file)
@@ -801,9 +801,10 @@ exec_filters(cups_array_t  *filters,       /* I - Array of filters to run */
 {
   int          i;                      /* Looping var */
   const char   *argv[8],               /* Command-line arguments */
-               *envp[11],              /* Environment variables */
+               *envp[12],              /* Environment variables */
                *temp;                  /* Temporary string */
   char         *optstr,                /* Filter options */
+               content_type[1024],     /* CONTENT_TYPE */
                cups_datadir[1024],     /* CUPS_DATADIR */
                cups_fontpath[1024],    /* CUPS_FONTPATH */
                cups_serverbin[1024],   /* CUPS_SERVERBIN */
@@ -832,6 +833,9 @@ exec_filters(cups_array_t  *filters,        /* I - Array of filters to run */
 
   optstr = escape_options(num_options, options);
 
+  filter = cupsArrayFirst(filters);
+  snprintf(content_type, sizeof(content_type), "CONTENT_TYPE=%s/%s",
+           filter->src->super, filter->src->type);
   snprintf(cups_datadir, sizeof(cups_datadir), "CUPS_DATADIR=%s", DataDir);
   snprintf(cups_fontpath, sizeof(cups_fontpath), "CUPS_FONTPATH=%s", FontPath);
   snprintf(cups_serverbin, sizeof(cups_serverbin), "CUPS_SERVERBIN=%s",
@@ -876,16 +880,17 @@ exec_filters(cups_array_t  *filters,      /* I - Array of filters to run */
     argv[4] = "1";
 
   envp[0]  = "<CFProcessPath>";
-  envp[1]  = cups_datadir;
-  envp[2]  = cups_fontpath;
-  envp[3]  = cups_serverbin;
-  envp[4]  = cups_serverroot;
-  envp[5]  = lang;
-  envp[6]  = path;
-  envp[7]  = ppd;
-  envp[8]  = rip_cache;
-  envp[9]  = userenv;
-  envp[10] = NULL;
+  envp[1]  = content_type;
+  envp[2]  = cups_datadir;
+  envp[3]  = cups_fontpath;
+  envp[4]  = cups_serverbin;
+  envp[5]  = cups_serverroot;
+  envp[6]  = lang;
+  envp[7]  = path;
+  envp[8]  = ppd;
+  envp[9]  = rip_cache;
+  envp[10] = userenv;
+  envp[11] = NULL;
 
   for (i = 0; argv[i]; i ++)
     fprintf(stderr, "DEBUG: argv[%d]=\"%s\"\n", i, argv[i]);