From: Zdenek Dohnal Date: Thu, 18 Feb 2021 07:49:56 +0000 (+0100) Subject: cups/dest.c: Remove an underscore from queue name X-Git-Tag: v2.4b1~202^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7ce03c62697637913460e4be5b1a295abf4b189;p=thirdparty%2Fcups.git cups/dest.c: Remove an underscore from queue name If the underscore is a last character in queue name, remove it - it looks better in print dialogs. --- diff --git a/CHANGES.md b/CHANGES.md index 15db8fa3f7..e317297ff2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ Changes in CUPS v2.4.0 - The `cupsfilter` command now shows error messages when options are used incorrectly (Issue #88) - Documentation fixes (Issue #92) +- Remove underscore from queue name if it is the last character (PR #56) Changes in CUPS v2.3.4 diff --git a/cups/dest.c b/cups/dest.c index 2017792a74..9b176dc0a3 100644 --- a/cups/dest.c +++ b/cups/dest.c @@ -4369,5 +4369,12 @@ cups_queue_name( *nameptr++ = '_'; } + /* + * Remove an underscore if it is the last character + * and isn't the only character in the string + */ + if (nameptr[-1] == '_' && nameptr > (name + 1)) + nameptr--; + *nameptr = '\0'; }