fix(set_bool_option): use int value to make bool Object

Boolean options are stored in an int, not a char, so dereferencing
"char *varp" is not portable to big-endian systems.
This commit is contained in:
James McCoy 2023-12-18 16:27:02 -05:00
parent 150f2b274d
commit 92d620ad92
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -2248,7 +2248,7 @@ static const char *set_bool_option(const int opt_idx, char *const varp, const in
if (options[opt_idx].flags & P_UI_OPTION) {
ui_call_option_set(cstr_as_string(options[opt_idx].fullname),
BOOLEAN_OBJ(*varp));
BOOLEAN_OBJ(*(int *)varp));
}
if ((int *)varp == &p_ru || (int *)varp == &p_sc) {
// in case 'ruler' or 'showcmd' changed