]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler and cupstestppd utilities did not support cupsFilter and
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 12 Jul 2008 16:44:15 +0000 (16:44 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Sat, 12 Jul 2008 16:44:15 +0000 (16:44 +0000)
cupsPreFilter programs with spaces in their names (STR #2866)

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

CHANGES-1.3.txt
scheduler/printers.c
systemv/cupstestppd.c

index a4a4aa1ac639880912cbe5beddd8192bd9569132..a2ff3d181308a014eeec82ac542f433cf9bc1785 100644 (file)
@@ -4,6 +4,9 @@ CHANGES-1.3.txt
 CHANGES IN CUPS V1.3.8
 
        - Documentation updates (STR #2785, STR #2861, STR #2862)
+       - The scheduler and cupstestppd utilities did not support
+         cupsFilter and cupsPreFilter programs with spaces in their
+         names (STR #2866)
        - Removed unused variables and assignments found by the
          LLVM "clang" tool.
        - Added NULL checks recommended by the LLVM "clang" tool.
index d923b323bf3f94ac1ed39c4381187794cd3f4e82..8d55e4dddbdf93da1c4e1b25da0f1bacf58b97bc 100644 (file)
@@ -3825,7 +3825,8 @@ add_printer_filter(
   *     super/type cost program
   */
 
-  if (sscanf(filter, "%15[^/]/%31s%d%1023s", super, type, &cost, program) != 4)
+  if (sscanf(filter, "%15[^/]/%31s%d%*[ \t]%1023[^\n]", super, type, &cost,
+             program) != 4)
   {
     cupsdLogMessage(CUPSD_LOG_ERROR, "%s: invalid filter string \"%s\"!",
                     p->name, filter);
index 7d8fe1a683f932482df4d4e240a566e01b6f540a..569708adfc183a977e7332fcf3f656ac10d2951a 100644 (file)
@@ -1831,11 +1831,12 @@ check_filters(ppd_file_t *ppd,          /* I - PPD file */
              int        verbose,       /* I - Verbosity level */
              int        warn)          /* I - Warnings only? */
 {
+  int          i;                      /* Looping var */
   ppd_attr_t   *attr;                  /* PPD attribute */
   const char   *ptr;                   /* Pointer into string */
   char         super[16],              /* Super-type for filter */
                type[256],              /* Type for filter */
-               program[256],           /* Program/filter name */
+               program[1024],          /* Program/filter name */
                pathprog[1024];         /* Complete path to program/filter */
   int          cost;                   /* Cost of filter */
   const char   *prefix;                /* WARN/FAIL prefix */
@@ -1843,13 +1844,10 @@ check_filters(ppd_file_t *ppd,          /* I - PPD file */
 
   prefix = warn ? "  WARN  " : "**FAIL**";
 
-  for (attr = ppdFindAttr(ppd, "cupsFilter", NULL);
-       attr;
-       attr = ppdFindNextAttr(ppd, "cupsFilter", NULL))
+  for (i = 0; i < ppd->num_filters; i ++)
   {
-    if (!attr->value ||
-       sscanf(attr->value, "%15[^/]/%255s%d%255s", super, type, &cost,
-              program) != 4)
+    if (sscanf(ppd->filters[i], "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type,
+               &cost, program) != 4)
     {
       if (!warn && !errors && !verbose)
        _cupsLangPuts(stdout, _(" FAIL\n"));
@@ -1857,7 +1855,7 @@ check_filters(ppd_file_t *ppd,            /* I - PPD file */
       if (verbose >= 0)
        _cupsLangPrintf(stdout,
                        _("      %s  Bad cupsFilter value \"%s\"!\n"),
-                       prefix, attr->value ? attr->value : "");
+                       prefix, ppd->filters[i]);
 
       if (!warn)
         errors ++;
@@ -1899,8 +1897,8 @@ check_filters(ppd_file_t *ppd,            /* I - PPD file */
        attr = ppdFindNextAttr(ppd, "cupsPreFilter", NULL))
   {
     if (!attr->value ||
-       sscanf(attr->value, "%15[^/]/%255s%d%255s", super, type, &cost,
-              program) != 4)
+       sscanf(attr->value, "%15[^/]/%255s%d%*[ \t]%1023[^\n]", super, type,
+              &cost, program) != 4)
     {
       if (!warn && !errors && !verbose)
        _cupsLangPuts(stdout, _(" FAIL\n"));