From 8f8e22dbdd4f9e2ff1604e47e0fc78ff5912d633 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 27 Feb 2023 09:18:15 -0600 Subject: colorize: stop parsing theme when other section starts In order to allow multiple sections in a styleset, colorize must stop parsing the theme when it encounters a new section. Signed-off-by: Robin Jarry Tested-by: Tim Culverhouse --- filters/colorize.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/filters/colorize.c b/filters/colorize.c index 307fe190..622184d7 100644 --- a/filters/colorize.c +++ b/filters/colorize.c @@ -352,8 +352,13 @@ static int parse_styleset(void) char obj[64], attr[64], val[64]; int changed = 0; - if (sscanf(buf, "%63[^.].%63[^=] = %63s", obj, attr, val) != 3) + if (sscanf(buf, "%63[^.].%63[^=] = %63s", obj, attr, val) != 3) { + if (buf[0] == '[') { + /* start of another section */ + break; + } continue; + } for (size_t o = 0; o < ARRAY_SIZE(ini_objects); o++) { if (fnmatch(obj, ini_objects[o].n, 0)) -- cgit v1.2.3-54-g00ecf