]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/cancel.c
Load cups into easysw/current.
[thirdparty/cups.git] / systemv / cancel.c
index 66394b9a380cfff6238231937ad6c753998c128d..8d057bbdd497b29ad0a5f906821317ff2ae8ebb4 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: cancel.c 4948 2006-01-19 03:23:41Z mike $"
+ * "$Id: cancel.c 6649 2007-07-11 21:46:42Z mike $"
  *
  *   "cancel" command for the Common UNIX Printing System (CUPS).
  *
+ *   Copyright 2007 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products 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 please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   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:
  *
@@ -60,6 +51,8 @@ main(int  argc,                               /* I - Number of command-line arguments */
   ipp_op_t     op;                     /* Operation */
 
 
+  _cupsSetLocale(argv);
+
  /*
   * Setup to cancel individual print jobs...
   */
@@ -121,7 +114,10 @@ main(int  argc,                            /* I - Number of command-line arguments */
 
         case 'h' : /* Connect to host */
            if (http != NULL)
+           {
              httpClose(http);
+             http = NULL;
+           }
 
            if (argv[i][2] != '\0')
               cupsSetServer(argv[i] + 2);
@@ -179,7 +175,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       if (num_dests == 0)
         num_dests = cupsGetDests(&dests);
 
-      if (strcmp(argv[i], "-") == 0)
+      if (!strcmp(argv[i], "-"))
       {
        /*
         * Delete the current job...
@@ -266,8 +262,8 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
       if (dest)
       {
-       httpAssembleURIf(uri, sizeof(uri), "ipp", NULL, "localhost", 0,
-                        "/printers/%s", dest);
+       httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL,
+                        "localhost", 0, "/printers/%s", dest);
        ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI,
                     "printer-uri", NULL, uri);
        ippAddInteger(request, IPP_TAG_OPERATION, IPP_TAG_INTEGER, "job-id",
@@ -307,8 +303,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
       {
        _cupsLangPrintf(stderr, _("%s: %s failed: %s\n"), argv[0],
                        op == IPP_PURGE_JOBS ? "purge-jobs" : "cancel-job",
-                       response ? ippErrorString(response->request.status.status_code) :
-                                  ippErrorString(cupsLastError()));
+                       cupsLastErrorString());
 
        if (response)
          ippDelete(response);
@@ -388,5 +383,5 @@ main(int  argc,                             /* I - Number of command-line arguments */
 
 
 /*
- * End of "$Id: cancel.c 4948 2006-01-19 03:23:41Z mike $".
+ * End of "$Id: cancel.c 6649 2007-07-11 21:46:42Z mike $".
  */