]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - berkeley/lpr.c
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / berkeley / lpr.c
index 6e36beed7f2841ef3e10c99037e349218b8f9d0c..eb58c8bd9f76180123c3eb1ce1970c3fca2658a0 100644 (file)
@@ -1,20 +1,14 @@
 /*
- * "$Id$"
+ * "lpr" command for CUPS.
  *
- *   "lpr" command for CUPS.
+ * Copyright 2007-2014 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products.
  *
- *   Copyright 2007-2012 by Apple Inc.
- *   Copyright 1997-2007 by Easy Software Products.
- *
- *   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/".
- *
- * Contents:
- *
- *   main() - Parse options and send files for printing.
+ * 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/".
  */
 
 /*
@@ -61,6 +55,7 @@ main(int  argc,                               /* I - Number of command-line arguments */
 
   for (i = 1; i < argc; i ++)
     if (argv[i][0] == '-')
+    {
       switch (ch = argv[i][1])
       {
         case 'E' : /* Encrypt */
@@ -226,6 +221,14 @@ main(int  argc,                            /* I - Number of command-line arguments */
                                              dest->options[j].value,
                                              num_options, &options);
            }
+           else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
+                    cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
+           {
+             _cupsLangPrintf(stderr,
+                             _("%s: Error - add '/version=1.1' to server "
+                               "name."), argv[0]);
+             return (1);
+           }
            break;
 
        case '#' : /* Number of copies */
@@ -275,6 +278,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
                            argv[i][1]);
            return (1);
       }
+    }
     else if (num_files < 1000)
     {
      /*
@@ -320,6 +324,14 @@ main(int  argc,                            /* I - Number of command-line arguments */
                                      dest->options[j].value,
                                      num_options, &options);
     }
+    else if (cupsLastError() == IPP_STATUS_ERROR_BAD_REQUEST ||
+            cupsLastError() == IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED)
+    {
+      _cupsLangPrintf(stderr,
+                     _("%s: Error - add '/version=1.1' to server "
+                       "name."), argv[0]);
+      return (1);
+    }
   }
 
   if (printer == NULL)
@@ -388,7 +400,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
     while (status == HTTP_CONTINUE &&
            (bytes = read(0, buffer, sizeof(buffer))) > 0)
-      status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, bytes);
+      status = cupsWriteRequestData(CUPS_HTTP_DEFAULT, buffer, (size_t)bytes);
 
     if (status != HTTP_CONTINUE)
     {
@@ -415,8 +427,3 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
   return (0);
 }
-
-
-/*
- * End of "$Id$".
- */