mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
config: In redir_set, negate the incoming value.
That is, let the setter function of the underlying option store the negated value. Previously, redir_set used to tweak the value of the option after it has already called the underlying setter.
This commit is contained in:
parent
7cdbc908d8
commit
2dbe6ec34f
@ -148,10 +148,13 @@ redir_set(struct option *opt, unsigned char *str)
|
|||||||
if_assert_failed { return ret; }
|
if_assert_failed { return ret; }
|
||||||
|
|
||||||
if (option_types[real->type].set) {
|
if (option_types[real->type].set) {
|
||||||
ret = option_types[real->type].set(real, str);
|
long negated;
|
||||||
|
|
||||||
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
|
if ((opt->flags & OPT_ALIAS_NEGATE) && real->type == OPT_BOOL) {
|
||||||
real->value.number = !real->value.number;
|
negated = !*(long *) str;
|
||||||
|
str = (unsigned char *) &negated;
|
||||||
}
|
}
|
||||||
|
ret = option_types[real->type].set(real, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user