config: error out on invalid grapheme-width-method values

This commit is contained in:
Daniel Eklöf 2021-10-21 16:17:41 +02:00
parent 5b66592a57
commit d60e303c33
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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);
}