mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
In l_set_option, use lua_toboolean for boolean options instead of
lua_tonumber. Now set_option(opt, not get_option(opt)) will always work to toggle a boolean option.
This commit is contained in:
parent
35e5ec74d2
commit
8edcb292cb
@ -493,6 +493,14 @@ l_set_option(LS)
|
|||||||
/* Set option */
|
/* Set option */
|
||||||
switch (opt->type) {
|
switch (opt->type) {
|
||||||
case OPT_BOOL:
|
case OPT_BOOL:
|
||||||
|
{
|
||||||
|
int value;
|
||||||
|
|
||||||
|
value = lua_toboolean(S, 2);
|
||||||
|
option_types[opt->type].set(opt, (unsigned char *) (&value));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case OPT_INT:
|
case OPT_INT:
|
||||||
case OPT_LONG:
|
case OPT_LONG:
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user