Skip to content

Conversation

@darkvision77
Copy link

@darkvision77 darkvision77 commented Jan 16, 2026

If the backend reports the device name “Canon LBP3200 (captusb)”, the parentheses and their contents are removed, leaving a space at the end, which is replaced with an underscore, resulting in “Canon_LBP3200_”.
This underscore at the end is extremely annoying.

Similar code in cups/dest.c:

cups/cups/dest.c

Lines 3971 to 3977 in 2f6411e

//
// Remove an underscore if it is the last character and isn't the only
// character in the name...
//
if (nameptr > (name + 1) && nameptr[-1] == '_')
nameptr --;

You can test this patch using a dummy backend:

#!/bin/sh
echo 'direct test://test1 "Canon LBP3200" "Canon LBP3200 (captusb)" "MFG:Canon;MDL:LBP3200;CMD:CAPT;VER:1.0;CLS:PRINTER;DES:Canon LBP3200" ""'
echo 'direct test://test2 "Canon LBP3200" "_" "MFG:Canon;MDL:LBP3200;CMD:CAPT;VER:1.0;CLS:PRINTER;DES:Canon LBP3200" ""'

Ref darkvision77/captppd#4 (comment)

@michaelrsweet michaelrsweet self-assigned this Jan 16, 2026
@michaelrsweet michaelrsweet added the investigating Investigating the issue label Jan 16, 2026
@michaelrsweet michaelrsweet added this to the v2.5 milestone Jan 16, 2026
@michaelrsweet
Copy link
Member

Will look at these changes - I like the idea but we also need to be careful about changing auto-generated names because it might cause side-effects or regressions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

investigating Investigating the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants