]> 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>
Wed, 22 Dec 2021 22:57:32 +0000 (19:57 -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.

NEWS
utils/cups-browsed.c

diff --git a/NEWS b/NEWS
index d7cda78a072ad27f7d9a7dd7c756a590a3eb187b..27313d4b98580c93bdad78579dc287c2d8cd71fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,10 @@ NEWS - OpenPrinting CUPS Filters v1.27.5 - 2020-06-05
 
 CHANGES IN V2.0.0
 
+       - 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: Removed now obsolete apply_filters() API
          function to call a chain of external CUPS filter
          executables, as we have filter functions now and even can
index 50210775d4afee68d851cb9f4b3c7df19547b495..f68118eb0215823994c8f5cb3312dd3505fb8e71 100644 (file)
@@ -3653,18 +3653,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);
 }