]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - systemv/lpmove.c
Import CUPS trunk (1.4svn) r7116.
[thirdparty/cups.git] / systemv / lpmove.c
index 27889fbd0bb87e3722975c8ee8e8f66f95c90924..0795737f1b68f049167bd4642c7dbe319784a679 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: lpmove.c 4945 2006-01-18 21:41:17Z mike $"
+ * "$Id: lpmove.c 6649 2007-07-11 21:46:42Z mike $"
  *
  *   "lpmove" 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:
  *
@@ -66,6 +57,8 @@ main(int  argc,                               /* I - Number of command-line arguments */
                *dest;                  /* New destination */
 
 
+  _cupsSetLocale(argv);
+
   dest      = NULL;
   dests     = NULL;
   http      = NULL;
@@ -128,6 +121,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
       if ((job = strrchr(argv[i], '-')) != NULL &&
           cupsGetDest(argv[i], NULL, num_dests, dests) == NULL)
         jobid = atoi(job + 1);
+      else if (isdigit(argv[i][0] & 255) &&
+               !cupsGetDest(argv[i], NULL, num_dests, dests))
+        jobid = atoi(argv[i]);
       else
         src = argv[i];
     }
@@ -202,8 +198,8 @@ move_job(http_t     *http,          /* I - HTTP connection to server */
   }
   else
   {
-    httpAssembleURIf(job_uri, sizeof(job_uri), "ipp", NULL, "localhost", 0,
-                     "/printers/%s", src);
+    httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL,
+                     "localhost", 0, "/printers/%s", src);
     ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL,
                 job_uri);
   }
@@ -211,8 +207,8 @@ move_job(http_t     *http,          /* I - HTTP connection to server */
   ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
                NULL, cupsUser());
 
-  httpAssembleURIf(printer_uri, sizeof(printer_uri), "ipp", NULL, "localhost", 0,
-                   "/printers/%s", dest);
+  httpAssembleURIf(HTTP_URI_CODING_ALL, printer_uri, sizeof(printer_uri),
+                   "ipp", NULL, "localhost", 0, "/printers/%s", dest);
   ippAddString(request, IPP_TAG_JOB, IPP_TAG_URI, "job-printer-uri",
                NULL, printer_uri);
 
@@ -233,5 +229,5 @@ move_job(http_t     *http,          /* I - HTTP connection to server */
 
 
 /*
- * End of "$Id: lpmove.c 4945 2006-01-18 21:41:17Z mike $".
+ * End of "$Id: lpmove.c 6649 2007-07-11 21:46:42Z mike $".
  */