]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The `cupsGetNamedDest` function did not use the local default printer
authorMichael Sweet <michael.r.sweet@gmail.com>
Wed, 19 Jul 2017 12:15:08 +0000 (08:15 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Wed, 19 Jul 2017 12:15:08 +0000 (08:15 -0400)
(rdar://33228500)

CHANGES.md
cups/dest.c
cups/testdest.c

index 7a0632736c853f23c443e2ef596bf5601f384605..966a2d94bedf4d0b838bbb4e922a010700d45a6c 100644 (file)
@@ -21,6 +21,8 @@ CHANGES IN CUPS V2.2.5
   printers (rdar://33250434)
 - Fixed the `cups.strings` file that is used on macOS (rdar://33287650)
 - CUPS now sends the `Date` HTTP header in IPP requests (rdar://33302034)
+- The `cupsGetNamedDest` function did not use the local default printer
+  (rdar://33228500)
 
 
 CHANGES IN CUPS V2.2.4
index 09bb76b73f1f2e1a099ac330560e0bb455692cfb..2bc4685c9c1dceff8d275f3ad6ba1025336e6fad 100644 (file)
@@ -2261,7 +2261,7 @@ cupsGetNamedDest(http_t     *http,        /* I - Connection to server or @code CUPS_HTT
       dest_name = cups_get_default(filename, defname, sizeof(defname), &instance);
     }
 
-    if (!name)
+    if (!dest_name)
     {
      /*
       * Still not there?  Try the system lpoptions file...
index a98d4092ca96aeb891c7d82e734169600253fb78..8505a1d834d16b36d5308e40217cbc5c8cc214cf 100644 (file)
@@ -105,6 +105,14 @@ main(int  argc,                            /* I - Number of command-line arguments */
   }
   else if (!strncmp(argv[1], "ipp://", 6) || !strncmp(argv[1], "ipps://", 7))
     dest = cupsGetDestWithURI(NULL, argv[1]);
+  else if (!strcmp(argv[1], "default"))
+  {
+    dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL);
+    if (dest && dest->instance)
+      printf("default is \"%s/%s\".\n", dest->name, dest->instance);
+    else
+      printf("default is \"%s\".\n", dest->name);
+  }
   else
     dest = cupsGetNamedDest(CUPS_HTTP_DEFAULT, argv[1], NULL);