From 72423c517a788843caa0f7cfaf99aa32b4b9a5fa Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 16 Jan 2019 09:29:17 +0100 Subject: [PATCH] webconfig: Fix binding tab This broke when --preset was introduced. We allow a "--preset" or "--user" to appear right after the "bind", and save the value, but don't use it yet. Fixes #5534. [ci skip] --- share/tools/web_config/webconfig.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index 58702f2fa..a5c5ef981 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -704,6 +704,20 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): for line in out.split('\n'): comps = line.split(' ', 2) + # If we don't have "bind", a sequence and a mapping, + # it's not a valid binding. + if len(comps) < 3: + continue + + # Store the "--preset" value for later + if comps[1] == '--preset': + preset = True + # There's possibly a way to do this faster, but it's not important. + comps = line.split(' ', 3)[1:] + elif comps[1] == '--user': + preset = False + comps = line.split(' ', 3)[1:] + # Check again if we removed the level. if len(comps) < 3: continue