hyperrealm / libconfig

C/C++ library for processing configuration files
https://hyperrealm.github.io/libconfig/
GNU Lesser General Public License v2.1
1.13k stars 366 forks source link

Behavior of `config_setting_lookup_*` is inconsistent with `config_setting_lookup` #242

Open yshui opened 3 months ago

yshui commented 3 months ago

For example config_setting_lookup_int does not call config_setting_lookup but instead calls config_setting_get_member, which unlike config_setting_lookup, requires the setting to be a group, and doesn't support indexing ([0]).

This is surprising. From the function name, one would expect config_setting_lookup_int to be the same as config_setting_get_int(config_setting_lookup()).