aboutsummaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-02-27 09:18:15 -0600
committerRobin Jarry <robin@jarry.cc>2023-03-02 22:50:01 +0100
commit8f8e22dbdd4f9e2ff1604e47e0fc78ff5912d633 (patch)
tree4c96512e4ff3f1dd4b525527dce08a866f52d79c /filters
parent49de9b09caccc83adb0d52f0642f2c39a5e6a7e2 (diff)
downloadaerc-8f8e22dbdd4f9e2ff1604e47e0fc78ff5912d633.tar.gz
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 <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'filters')
-rw-r--r--filters/colorize.c7
1 files changed, 6 insertions, 1 deletions
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))