PPD search doesn't expect a '-' character in device name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HPLIP |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
we have a following report in Fedora:
https:/
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