]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
parse_hwdb: enforce the ":*" suffix
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 15 Oct 2020 11:54:31 +0000 (13:54 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 15 Oct 2020 16:01:32 +0000 (18:01 +0200)
hwdb.d/parse_hwdb.py

index 025133416f6e23c23ce64f1dfad9bc96f0d84a76..09751634a4dc6df85a660d4af6fc45c50e1c880a 100755 (executable)
@@ -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