Align YAML config getlist with libconfig implementation
This aligns the behavior of params_yaml with params_config library so that when a mapping is read using getlist it returns the number of elements in the mapping instead of 0.
This commit is contained in:
@@ -286,10 +286,10 @@ extern "C" int config_yaml_getlist(configmodule_interface_t *cfg,
|
||||
return -1;
|
||||
}
|
||||
|
||||
ParamList->numelt = node.size();
|
||||
if (!node.IsSequence()) {
|
||||
return -1;
|
||||
}
|
||||
ParamList->numelt = node.size();
|
||||
|
||||
if (ParamList->numelt > 0 && params != NULL) {
|
||||
ParamList->paramarray = static_cast<paramdef_t **>(config_allocate_new(cfg, ParamList->numelt * sizeof(paramdef_t *), true));
|
||||
|
||||
Reference in New Issue
Block a user