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)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant