]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
cups-browsed: Fix broken trailing space removal on "NickName". 103/head
authorOliver Freyermuth <o.freyermuth@googlemail.com>
Tue, 2 Apr 2019 18:19:46 +0000 (20:19 +0200)
committerOliver Freyermuth <o.freyermuth@googlemail.com>
Tue, 2 Apr 2019 18:19:46 +0000 (20:19 +0200)
The code tried to remove trailing spaces, but if there was
at least one trailing space, the last two characters of the
line were removed. This caused removal of the quotation mark
in case exactly one trailing space was present, breaking
the PPD and subsequently causing CUPS to mess up all queues
(even local ones).

Signed-off-by: Oliver Freyermuth <o.freyermuth@googlemail.com>
utils/cups-browsed.c

index ac4392012da440327b2ba45199ae7366fda8b107..1e3ba18c69571f854b16a470fe357c79c4859f5d 100644 (file)
@@ -5277,8 +5277,8 @@ gboolean update_cups_queues(gpointer unused) {
              memmove(ptr, prefix, strlen(prefix));
              ptr = line + strlen(line) - 1;
              while(isspace(*ptr) && ptr > line) {
-               ptr --;
                *ptr = '\0';
+               ptr --;
              }
              if (*ptr != '"') {
                if (ptr < line + sizeof(line) - 2) {