Skip to content

Commit

Permalink
plugins: remove 'blank' option parsing for bool
Browse files Browse the repository at this point in the history
bools must be set!
  • Loading branch information
niftynei committed Mar 17, 2020
1 parent 6c76b96 commit d0aa618
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lightningd/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ char *plugin_opt_set(const char *arg, struct plugin_opt *popt)
if (streq(arg, "true") || streq(arg, "True") || streq(arg, "1")) {
*popt->value->as_bool = true;
} else if (streq(arg, "false") || streq(arg, "False")
|| streq(arg, "0") || streq(arg, "")) {
|| streq(arg, "0")) {
*popt->value->as_bool = false;
} else
return tal_fmt(tmpctx, "%s does not parse as type %s",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_option_types(node_factory):
n = node_factory.get_node(options={
'plugin': plugin_path, 'str_opt': 'ok',
'int_opt': 22,
'bool_opt': '',
'bool_opt': 'true',
'flag_opt': None,
})

Expand Down

0 comments on commit d0aa618

Please sign in to comment.