diff --git a/source/libublsettings-config.c b/source/libublsettings-config.c index 3c50019..a976c11 100644 --- a/source/libublsettings-config.c +++ b/source/libublsettings-config.c @@ -1563,14 +1563,12 @@ int yon_config_update_by_list(config_str keys, size_t size){ return 0; } -int yon_config_update_by_args(char *key, ...){ +int yon_config_update_by_args(char *config_path, ...){ check_config{ int size=0; config_str keys = NULL; - yon_char_parsed_add_or_create_if_exists(keys,&size,key); va_list args; - yon_config_remove_by_key(key); - va_start(args,key); + va_start(args,config_path); char *cur_key = NULL; while((cur_key = va_arg(args,char*))){ yon_char_parsed_add_or_create_if_exists(keys,&size,cur_key); @@ -1580,7 +1578,7 @@ int yon_config_update_by_args(char *key, ...){ int params_size=0; config_str parameters = yon_config_get_load_parameters_by_list(¶ms_size,keys,size); if (params_size&¶meters){ - char *path = yon_config_command_get_path(config_last_load_command); + char *path = config_path; char *parameters_str = yon_char_parsed_to_string(parameters,params_size," -- get "); char *command = yon_char_unite(ubconfig_load_command(path), parameters_str, NULL); yon_config_load_config(YON_CONFIG_CUSTOM,command,NULL); diff --git a/source/libublsettings.h b/source/libublsettings.h index d1f87d3..fefee27 100644 --- a/source/libublsettings.h +++ b/source/libublsettings.h @@ -1565,10 +1565,10 @@ int yon_config_update_by_key(char *key); int yon_config_update_by_list(config_str keys, size_t size); /// @brief Update parameters value from configuration. -/// @param key First parameter's key. +/// @param config_path Configuration path where from to update parameter. /// @param ... NULL-terminated list of parameter keys. /// @return TRUE if parameter successfully updated, FALSE if parameter doesn't registered in configuration -int yon_config_update_by_args(char *key, ...); +int yon_config_update_by_args(char *config_path, ...); /**int yon_config_force_save_registered(char *path, char *section) * [EN]