From c68480b466ded92792891b505c1d3255c92a4491 Mon Sep 17 00:00:00 2001 From: Andrey Antufyev Date: Fri, 16 Jan 2026 10:29:08 +0300 Subject: [PATCH] Remove underscore from printer name if it is the last --- cgi-bin/admin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 7d19971137..e1bdcfa0aa 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -2080,6 +2080,10 @@ do_list_printers(http_t *http) /* I - HTTP connection */ else if (*ptr == '?' || *ptr == '(') break; + // Remove the underscore if it is the last and not the only character + if (option_ptr > (option + 1) && option_ptr[-1] == '_') + option_ptr--; + *option_ptr = '\0'; cgiSetArray("TEMPLATE_NAME", i, option);