PPD search doesn't expect a '-' character in device name

Bug #1881587 reported by zdohnal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Hi,

we have a following report in Fedora:

https://bugzilla.redhat.com/show_bug.cgi?id=1590014

which is caused by a bug in PPD search algorithm (getPPDFile2()), which doesn't expect a '-' char to be in device name e.g. HP Photosmart Premium C309g-m.

This results in the script thinking '-m' is a new PDL and so returns the first matched PPD, which is hpijs. hpcups preference over hpijs is never applied.

The attached patch fixes it, it sanitizes ending '-' strings - if it is a known PDL (ps/pdf), it records the PDL, if it is a filter type, it records the filter type (hpcups, hpijs). If the string is not recognized by either as filter type or PDL, it assumes it is the device name.

I cleaned up the function too, removed unnecessary ifs etc.

Would you mind adding the patch to the project? Please let me know if I should change the patch somehow to your liking.

Thank you in advance!

Zdenek

Revision history for this message
zdohnal (zdohnal) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.