From ad2d8e61eeab27f3e36572c7981362227357f420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 15 Oct 2020 13:54:31 +0200 Subject: [PATCH] parse_hwdb: enforce the ":*" suffix --- hwdb.d/parse_hwdb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hwdb.d/parse_hwdb.py b/hwdb.d/parse_hwdb.py index 025133416f..09751634a4 100755 --- a/hwdb.d/parse_hwdb.py +++ b/hwdb.d/parse_hwdb.py @@ -201,8 +201,9 @@ def check_matches(groups): except ParseBaseException as e: error('Pattern {!r} is invalid: {}', rest, e) continue - if rest[-1] not in '*:': - error('pattern {} does not end with "*" or ":"', match) + + if not rest.endswith(':*'): + error("pattern {!r} does not end with ':*'", match) matches.sort() prev = None