]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
cups-browsed: Updated naming of locally created print queues
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 22 Dec 2021 22:57:32 +0000 (19:57 -0300)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sat, 15 Jan 2022 21:28:14 +0000 (18:28 -0300)
Naming of local queues created by cups-browsed is now matched to CUPS'
current naming of temporary queues (no leading or trailing
underscores), to avoid duplicates in print dialogs which support CUPS'
temporary queues.

(cherry picked from commit 3d9c4804cd36ba205a1dc8f39f5b28bc64d4fc77)

NEWS
utils/cups-browsed.c

diff --git a/NEWS b/NEWS
index 6ff7bdaa0391d2b88f9e73cb54ba1fc9d9940c88..32b239676af230e786cfd0db66ba72f56851f5a0 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,10 @@ NEWS - OpenPrinting CUPS Filters v1.28.10 - 2021-08-17
 
 CHANGES IN V1.28.11
 
+       - cups-browsed: Naming of local queues is matched to CUPS'
+         current naming of temporary queues (no leading or trailing
+         underscores), to avoid duplicates in print dialogs which
+         support CUPS' temporary queues.
        - libcupsfilters: Make cupsRasterParseIPPOptions() work correctly
          with PPDs (Issue #436).
        - Build system: Make missing DejaVuSans.ttf non-fatal in
index 4c0b3fdf1a279afca14d510047955104cc249e90..9971209ff10f3bcaeabcb2b1ca4ce5ce32034a8d 100644 (file)
@@ -3620,18 +3620,16 @@ remove_bad_chars(const char *str_orig, /* I - Original string */
   /* Add terminating zero */
   str[j] = '\0';
 
-  i = 0;
-  if (mode != 2) {
-    /* Cut off trailing separators */
-    while (strlen(str) > 0 && str[strlen(str)-1] == sep)
-      str[strlen(str)-1] = '\0';
+  /* Cut off trailing separators */
+  while (strlen(str) > 0 && str[strlen(str) - 1] == sep)
+    str[strlen(str) - 1] = '\0';
 
-    /* Cut off leading separators */
-    while (str[i] == sep)
-      ++i;
-  }
+  /* Cut off leading separators */
+  i = 0;
+  while (str[i] == sep)
+    i ++;
 
-  /* keep a free()-able string. +1 for trailing \0 */
+  /* Keep a free()-able string. +1 for trailing \0 */
   return memmove(str, str + i, strlen(str) - i + 1);
 }