1
0
forked from drath/libratbag

tools: ratbagctl: kill an infinite loop in parsing

Calling "ratbagctl profile -t" resulted in an infinite loop because it
tried again and again to parse "-t" in the profile

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2017-08-21 18:13:10 +02:00
committed by Peter Hutterer
parent 58957667e1
commit faaf93b194

View File

@@ -1300,8 +1300,9 @@ class RatbagParserRoot(object):
pr_debug(ns, "<<< {}: {} | {}".format(child.type, child.name, rest))
while subparser:
old_rest = rest
ns, rest = subparser.parse_known_args(rest, namespace=ns)
if not rest:
if not rest or old_rest == rest:
break
pr_debug(ns, ns, rest)
try: