]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix "make check" when there are no native CUPS filters on the system.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 22 May 2015 17:26:40 +0000 (17:26 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 22 May 2015 17:26:40 +0000 (17:26 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12655 a1ca3aef-8c08-0410-bb20-df032aa958be

filter/gziptoany.c
filter/pstops.c

index 6744c3bfa90a65ad25a5e60753a3db49ab7f4ae6..9adc376fabb1f3911c9f9cab90d90f24f6cf4d89 100644 (file)
@@ -3,7 +3,7 @@
  *
  * GZIP/raw pre-filter for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1993-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the
@@ -40,7 +40,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
   * Check command-line...
   */
 
-  if (argc != 7)
+  if (argc < 6 || argc > 7)
   {
     _cupsLangPrintf(stderr,
                     _("Usage: %s job-id user title copies options [file]"),
@@ -62,8 +62,14 @@ main(int  argc,                              /* I - Number of command-line arguments */
   * Open the file...
   */
 
-  if ((fp = cupsFileOpen(argv[6], "r")) == NULL)
+  if (argc == 6)
   {
+    copies = 1;
+    fp     = cupsFileStdin();
+  }
+  else if ((fp = cupsFileOpen(argv[6], "r")) == NULL)
+  {
+    fprintf(stderr, "DEBUG: Unable to open \"%s\".\n", argv[6]);
     _cupsLangPrintError("ERROR", _("Unable to open print file"));
     return (1);
   }
@@ -85,7 +91,8 @@ main(int  argc,                               /* I - Number of command-line arguments */
        _cupsLangPrintFilter(stderr, "ERROR",
                             _("Unable to write uncompressed print data: %s"),
                             strerror(errno));
-       cupsFileClose(fp);
+        if (argc == 7)
+         cupsFileClose(fp);
 
        return (1);
       }
@@ -97,7 +104,8 @@ main(int  argc,                              /* I - Number of command-line arguments */
   * Close the file and return...
   */
 
-  cupsFileClose(fp);
+  if (argc == 7)
+    cupsFileClose(fp);
 
   return (0);
 }
index 49c6e3c25ea31829a3e83b4ee820131dcbffae24..379740e48f90b8384e4d3899fadc4afec53e5e52 100644 (file)
@@ -3,7 +3,7 @@
  *
  * PostScript filter for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1993-2007 by Easy Software Products.
  *
  * These coded instructions, statements, and computer programs are the