]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The lp and lpr commands incorrectly ignored the default printer set in the
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 25 Jun 2013 15:02:18 +0000 (15:02 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 25 Jun 2013 15:02:18 +0000 (15:02 +0000)
lpoptions file (<rdar://problem/14216472>)

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11060 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.6.txt
cups/dest.c
cups/testcups.c
cups/testppd.c

index a541a07e2a306f512862b066281ebbf19b7a50b6..7e274ff5325c954769364735c9e452d7bbf19709 100644 (file)
@@ -7,6 +7,8 @@ CHANGES IN CUPS V1.6.3
        - Fixed a compile problem on AIX (STR #4307)
        - Added documentation about the /version=1.1 option to ServerName in
          client.conf (<rdar://problem/14216262>)
+       - The lp and lpr commands incorrectly ignored the default printer set
+         in the lpoptions file (<rdar://problem/14216472>)
        - Fixed a URI encoding issue for hostnames containing the ` (backquote)
          character (<rdar://problem/14243133>)
        - Added support for RFC 6874's IPv6 link local address format in URIs
index 0af7ebaa613ee2b495724a85a2df1577676932c4..2579d16a3a8d5be7c9468c7101792bd1a4f7b8f0 100644 (file)
@@ -933,8 +933,8 @@ cupsEnumDests(
   * Get the list of local printers and pass them to the callback function...
   */
 
-  num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL, &dests,
-                            type, mask);
+  num_dests = _cupsGetDests(CUPS_HTTP_DEFAULT, IPP_OP_CUPS_GET_PRINTERS, NULL,
+                            &dests, type, mask);
 
   for (i = num_dests, dest = dests;
        i > 0 && (!cancel || !*cancel);
@@ -1344,9 +1344,9 @@ _cupsGetDestResource(
 /*
  * '_cupsGetDests()' - Get destinations from a server.
  *
- * "op" is IPP_OP_CUPS_GET_PRINTERS to get a full list, IPP_OP_CUPS_GET_DEFAULT to get the
- * system-wide default printer, or IPP_OP_GET_PRINTER_ATTRIBUTES for a known
- * printer.
+ * "op" is IPP_OP_CUPS_GET_PRINTERS to get a full list, IPP_OP_CUPS_GET_DEFAULT
+ * to get the system-wide default printer, or IPP_OP_GET_PRINTER_ATTRIBUTES for
+ * a known printer.
  *
  * "name" is the name of an existing printer and is only used when "op" is
  * IPP_OP_GET_PRINTER_ATTRIBUTES.
@@ -1661,7 +1661,6 @@ int                                       /* O - Number of destinations */
 cupsGetDests2(http_t      *http,       /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */
               cups_dest_t **dests)     /* O - Destinations */
 {
-  int          i;                      /* Looping var */
   int          num_dests;              /* Number of destinations */
   cups_dest_t  *dest;                  /* Destination pointer */
   const char   *home;                  /* HOME environment variable */
@@ -1784,21 +1783,16 @@ cupsGetDests2(http_t      *http,        /* I - Connection to server or @code CUPS_HTTP_
       * Have a default; see if it is real...
       */
 
-      dest = cupsGetDest(dest->name, NULL, num_reals, reals);
-    }
-
-   /*
-    * If dest is NULL, then no default (that exists) is set, so we
-    * need to set a default if one exists...
-    */
-
-    if (!dest && *dests && defprinter)
-    {
-      for (i = 0; i < num_dests; i ++)
-        (*dests)[i].is_default = 0;
+      if (!cupsGetDest(dest->name, NULL, num_reals, reals))
+      {
+       /*
+        * Remove the non-real printer from the list, since we don't want jobs
+        * going to an unexpected printer... (<rdar://problem/14216472>)
+        */
 
-      if ((dest = cupsGetDest(name, instance, num_dests, *dests)) != NULL)
-       dest->is_default = 1;
+        num_dests = cupsRemoveDest(dest->name, dest->instance, num_dests,
+                                   dests);
+      }
     }
 
    /*
index 63e9478d6d67ad9a931ee7fa0b1cf2ac90824fdb..00a22965ac3ede77122745fe7905783941538d8a 100644 (file)
@@ -24,6 +24,7 @@
  * Include necessary headers...
  */
 
+#undef _CUPS_NO_DEPRECATED
 #include "string-private.h"
 #include "cups.h"
 #include "ppd.h"
index aa4a060684d33d8959d032400f1ead5d6bb883f0..aee7db4656d8b1e9c6e861aa9ebc80f29c1b4fe9 100644 (file)
@@ -3,7 +3,7 @@
  *
  *   PPD test program for CUPS.
  *
- *   Copyright 2007-2012 by Apple Inc.
+ *   Copyright 2007-2013 by Apple Inc.
  *   Copyright 1997-2006 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
@@ -23,6 +23,7 @@
  * Include necessary headers...
  */
 
+#undef _CUPS_NO_DEPRECATED
 #include "cups-private.h"
 #include <sys/stat.h>
 #ifdef WIN32