summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-03-19 15:23:10 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-03-19 16:47:46 +0100
commit0f4ef874ca6a7a72233b55dc85331f387b329c69 (patch)
tree2a41537cd6f126bfd5e607a306560e8fde643972
parentd47d9c5ed5a81547bbe8a47188649a026bd99e9e (diff)
downloadweechat-0f4ef874ca6a7a72233b55dc85331f387b329c69.zip
core: do not call check callback when setting default value of option
-rw-r--r--src/core/wee-config-file.c12
-rw-r--r--tests/unit/core/test-core-config-file.cpp2
2 files changed, 1 insertions, 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));