mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
config: scrollback.indicator.text: use value_to_wchars()
This commit is contained in:
parent
ff6b0fe011
commit
c0e67e7c2f
1 changed files with 2 additions and 13 deletions
15
config.c
15
config.c
|
|
@ -1151,19 +1151,8 @@ parse_section_scrollback(struct context *ctx)
|
|||
} else if (strcmp(value, "line") == 0) {
|
||||
conf->scrollback.indicator.format
|
||||
= SCROLLBACK_INDICATOR_FORMAT_LINENO;
|
||||
} else {
|
||||
free(conf->scrollback.indicator.text);
|
||||
conf->scrollback.indicator.text = NULL;
|
||||
|
||||
size_t len = mbstowcs(NULL, value, 0);
|
||||
if (len == (size_t)-1) {
|
||||
LOG_CONTEXTUAL_ERRNO("invalid free form text");
|
||||
return false;
|
||||
}
|
||||
|
||||
conf->scrollback.indicator.text = xcalloc(len + 1, sizeof(wchar_t));
|
||||
mbstowcs(conf->scrollback.indicator.text, value, len + 1);
|
||||
}
|
||||
} else
|
||||
return value_to_wchars(ctx, &conf->scrollback.indicator.text);
|
||||
}
|
||||
|
||||
else if (strcmp(key, "multiplier") == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue