aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-10-21 14:17:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-10-21 14:17:41 +0000
commitd60e303c33f6719068546da910e877df1b506c2d (patch)
treeeb03afd8fa2893f4a1379e9194f937e5ea190701 /config.c
parentrender: tab -> spaces (diff)
config: error out on invalid grapheme-width-method values
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.c b/config.c
index d437b05e..8be36fea 100644
--- a/config.c
+++ b/config.c
@@ -2405,6 +2405,13 @@ parse_section_tweak(
conf->tweak.grapheme_width_method = GRAPHEME_WIDTH_DOUBLE;
else if (strcmp(value, "wcswidth") == 0)
conf->tweak.grapheme_width_method = GRAPHEME_WIDTH_WCSWIDTH;
+ else {
+ LOG_AND_NOTIFY_ERR(
+ "%s:%d: [tweak]: %s: invalid 'grapheme-width-method, "
+ "expected one of 'wcswidth' or 'double-width'",
+ path, lineno, value);
+ return false;
+ }
LOG_WARN("%s:%d [tweak]: grapheme-width-method=%s", path, lineno, value);
}