hwdb: fix check for uppercasedness of match patterns
The check was added in 77547d53, but it doesn't work as expected. Because the second part is wrapped in Optional(), it would silently "succeed" when the lowercase digits were in the second part: >>> from parse_hwdb import * >>> g = 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4)) >>> g.parseString('v04D8pE11C*') (['v', '04D8', 'p', 'E11C'], {}) >>> g.parseString('v04D8pe11c*') (['v', '04D8'], {}) The following matches are OK: usb:v0627p0001:*QEMU USB Keyboard* usb:v0627p0001:* usb:v0627p0001* usb:v0627* (cherry picked from commit 1a37237e)
Loading