]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/dest.c
Import all of the bug fixes from the OpenPrinting CUPS repository.
[thirdparty/cups.git] / cups / dest.c
index cde987a0951f2f9a27e8d2e973aca34ee6f903fd..4d0c250326f3449aae73b81885ddef2120e085e3 100644 (file)
@@ -1839,7 +1839,10 @@ cupsGetNamedDest(http_t     *http,       /* I - Connection to server or @code CUPS_HTT
       cupsEnumDests(0, 1000, NULL, 0, 0, (cups_dest_cb_t)cups_name_cb, &data);
 
       if (!data.dest)
+      {
+        _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, _("The printer or class does not exist."), 1);
         return (NULL);
+      }
 
       dest = data.dest;
     }
@@ -4366,5 +4369,13 @@ cups_queue_name(
       *nameptr++ = '_';
   }
 
+ /*
+  * Remove an underscore if it is the last character and isn't the only
+  * character in the name...
+  */
+
+  if (nameptr > (name + 1) && nameptr[-1] == '_')
+    nameptr --;
+
   *nameptr = '\0';
 }