]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/cupstestppd.c
Fix source file header text duplication text duplication.
[thirdparty/cups.git] / systemv / cupstestppd.c
index 7b4655eed6b08cb0773f05c33daeda679b32b5c9..dbce718658be6094d252f76e18e894500dc50f14 100644 (file)
@@ -1,20 +1,18 @@
 /*
- * "$Id$"
+ * PPD test program for CUPS.
  *
- *   PPD test program for CUPS.
+ * Copyright 2007-2016 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
- *   Copyright 2007-2015 by Apple Inc.
- *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file.  If this file is
+ * missing or damaged, see the license at "http://www.cups.org/".
  *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   which should have been included with this file.  If this file is
- *   file is missing or damaged, see the license at "http://www.cups.org/".
+ * PostScript is a trademark of Adobe Systems, Inc.
  *
- *   PostScript is a trademark of Adobe Systems, Inc.
- *
- *   This file is subject to the Apple OS-Developed Software exception.
+ * This file is subject to the Apple OS-Developed Software exception.
  */
 
 /*
@@ -2371,8 +2369,40 @@ check_filters(ppd_file_t *ppd,           /* I - PPD file */
 
       if (!warn)
         errors ++;
+
+      continue;
     }
-    else if (strcmp(program, "-"))
+
+    if (!strncmp(program, "maxsize(", 8))
+    {
+      char     *mptr;                  /* Pointer into maxsize(nnnn) program */
+
+      strtoll(program + 8, &mptr, 10);
+
+      if (*mptr != ')')
+      {
+       if (!warn && !errors && !verbose)
+         _cupsLangPuts(stdout, _(" FAIL"));
+
+       if (verbose >= 0)
+         _cupsLangPrintf(stdout,
+                         _("      %s  Bad cupsFilter value \"%s\"."),
+                         prefix, attr->value);
+
+       if (!warn)
+         errors ++;
+
+       continue;
+      }
+
+      mptr ++;
+      while (_cups_isspace(*mptr))
+       mptr ++;
+
+      _cups_strcpy(program, mptr);
+    }
+
+    if (strcmp(program, "-"))
     {
       if (program[0] == '/')
        snprintf(pathprog, sizeof(pathprog), "%s%s", root, program);
@@ -2457,8 +2487,40 @@ check_filters(ppd_file_t *ppd,           /* I - PPD file */
 
       if (!warn)
         errors ++;
+
+      continue;
     }
-    else if (strcmp(program, "-"))
+
+    if (!strncmp(program, "maxsize(", 8))
+    {
+      char     *mptr;                  /* Pointer into maxsize(nnnn) program */
+
+      strtoll(program + 8, &mptr, 10);
+
+      if (*mptr != ')')
+      {
+       if (!warn && !errors && !verbose)
+         _cupsLangPuts(stdout, _(" FAIL"));
+
+       if (verbose >= 0)
+         _cupsLangPrintf(stdout,
+                         _("      %s  Bad cupsFilter2 value \"%s\"."),
+                         prefix, attr->value);
+
+       if (!warn)
+         errors ++;
+
+       continue;
+      }
+
+      mptr ++;
+      while (_cups_isspace(*mptr))
+       mptr ++;
+
+      _cups_strcpy(program, mptr);
+    }
+
+    if (strcmp(program, "-"))
     {
       if (strncmp(program, "maxsize(", 8) &&
           (ptr = strchr(program + 8, ')')) != NULL)
@@ -3060,7 +3122,7 @@ check_sizes(ppd_file_t *ppd,              /* I - PPD file */
   const char   *prefix;                /* WARN/FAIL prefix */
   ppd_option_t *page_size,             /* PageSize option */
                *page_region;           /* PageRegion option */
-  _pwg_media_t *pwg_media;             /* PWG media */
+  pwg_media_t  *pwg_media;             /* PWG media */
   char         buf[PPD_MAX_NAME];      /* PapeSize name that is supposed to be */
   const char   *ptr;                   /* Pointer into string */
   int          width_2540ths,          /* PageSize width in 2540ths */
@@ -3969,8 +4031,3 @@ valid_utf8(const char *s)         /* I - String to check */
 
   return (1);
 }
-
-
-/*
- * End of "$Id$".
- */