From 0f4ef874ca6a7a72233b55dc85331f387b329c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 19 Mar 2023 15:23:10 +0100 Subject: core: do not call check callback when setting default value of option --- src/core/wee-config-file.c | 12 ------------ tests/unit/core/test-core-config-file.cpp | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index cd78c705a..0cbf88bd1 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -1864,18 +1864,6 @@ config_file_option_set_default (struct t_config_option *option, rc = WEECHAT_CONFIG_OPTION_SET_ERROR; - if (option->callback_check_value) - { - if (!(int)(option->callback_check_value) ( - option->callback_check_value_pointer, - option->callback_check_value_data, - option, - value)) - { - return WEECHAT_CONFIG_OPTION_SET_ERROR; - } - } - if (value) { old_value_was_null = (option->default_value == NULL); diff --git a/tests/unit/core/test-core-config-file.cpp b/tests/unit/core/test-core-config-file.cpp index b63b3b168..8b2bfe0f9 100644 --- a/tests/unit/core/test-core-config-file.cpp +++ b/tests/unit/core/test-core-config-file.cpp @@ -915,7 +915,7 @@ TEST(CoreConfigFileWithNewOptions, OptionSetDefault) /* string */ STRCMP_EQUAL("value", CONFIG_STRING_DEFAULT(ptr_option_str)); - LONGS_EQUAL(WEECHAT_CONFIG_OPTION_SET_ERROR, + LONGS_EQUAL(WEECHAT_CONFIG_OPTION_SET_OK_CHANGED, config_file_option_set_default (ptr_option_str, "xxx", 1)); LONGS_EQUAL(WEECHAT_CONFIG_OPTION_SET_OK_CHANGED, config_file_option_set_default (ptr_option_str, "test", 1)); -- cgit v1.2.3