]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Treat common option name prefixes as a warning and not an error.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 20 Feb 2003 14:19:30 +0000 (14:19 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Thu, 20 Feb 2003 14:19:30 +0000 (14:19 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@3393 7a7537e8-13f0-0310-91df-b6672ffda945

systemv/cupstestppd.c

index a3adc54ff2f4d925c401f2a6e346a8f8b753a139..e7d550cc41535873f0d06fafe9bc9886854142cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: cupstestppd.c,v 1.15 2003/02/20 14:11:40 mike Exp $"
+ * "$Id: cupstestppd.c,v 1.16 2003/02/20 14:19:30 mike Exp $"
  *
  *   PPD test program for the Common UNIX Printing System (CUPS).
  *
@@ -336,35 +336,6 @@ main(int  argc,                    /* I - Number of command-line arguments */
 
            errors ++;
          }
-
-         /*
-         * Then verify that no other options share a common root name.
-         */
-
-         len = strlen(option->keyword);
-
-         for (m = 0, group2 = ppd->groups;
-              m < ppd->num_groups;
-              m ++, group2 ++)
-           for (n = 0, option2 = group2->options;
-                n < group2->num_options;
-                n ++, option2 ++)
-             if (option != option2 &&
-                 len < strlen(option2->keyword) &&
-                 !strncmp(option->keyword, option2->keyword, len))
-             {
-               if (verbose >= 0)
-               {
-                 if (!errors && !verbose)
-                   puts(" FAIL");
-
-                 printf("      **FAIL**  %s shares a common prefix with %s\n",
-                        option->keyword, option2->keyword);
-                 puts("                REF: Page 15, section 3.2.");
-               }
-
-               errors ++;
-             }
        }
 
       if (ppdFindAttr(ppd, "FileVersion", NULL) != NULL)
@@ -718,6 +689,33 @@ main(int  argc,                    /* I - Number of command-line arguments */
          puts("        WARN    ShortNickName required by PPD 4.3 spec.");
          puts("                REF: Pages 64-65, section 5.3.");
        }
+
+       /*
+        * Check for options with a common prefix, e.g. Duplex and Duplexer,
+       * which are errors according to the spec but won't cause problems
+       * with CUPS specifically...
+       */
+
+       for (j = 0, group = ppd->groups; j < ppd->num_groups; j ++, group ++)
+         for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
+         {
+           len = strlen(option->keyword);
+
+           for (m = 0, group2 = ppd->groups;
+                m < ppd->num_groups;
+                m ++, group2 ++)
+             for (n = 0, option2 = group2->options;
+                  n < group2->num_options;
+                  n ++, option2 ++)
+               if (option != option2 &&
+                   len < strlen(option2->keyword) &&
+                   !strncmp(option->keyword, option2->keyword, len))
+               {
+                 printf("        WARN    %s shares a common prefix with %s\n",
+                        option->keyword, option2->keyword);
+                 puts("                REF: Page 15, section 3.2.");
+               }
+         }
       }
 
       if (verbose > 0)
@@ -869,5 +867,5 @@ usage(void)
 
 
 /*
- * End of "$Id: cupstestppd.c,v 1.15 2003/02/20 14:11:40 mike Exp $".
+ * End of "$Id: cupstestppd.c,v 1.16 2003/02/20 14:19:30 mike Exp $".
  */