plugins: remove 'blank' option parsing for bool

bools must be set!
This commit is contained in:
lisa neigut 2020-03-16 21:00:18 -05:00 committed by Rusty Russell
parent 42cce55b45
commit 563b46814b
2 changed files with 2 additions and 2 deletions

View File

@ -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",

View File

@ -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,
})