Skip to content

Commit c3518d7

Browse files
Merge pull request #1472 from darkvision77/rm-last-underscore
Remove the underscore from printer name if it is the last and not the only character
2 parents ef959be + c68480b commit c3518d7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cgi-bin/admin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,10 @@ do_list_printers(http_t *http) /* I - HTTP connection */
20802080
else if (*ptr == '?' || *ptr == '(')
20812081
break;
20822082

2083+
// Remove the underscore if it is the last and not the only character
2084+
if (option_ptr > (option + 1) && option_ptr[-1] == '_')
2085+
option_ptr--;
2086+
20832087
*option_ptr = '\0';
20842088

20852089
cgiSetArray("TEMPLATE_NAME", i, option);

0 commit comments

Comments
 (0)