diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-12-24 07:53:37 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-12-24 07:53:37 +0100 |
commit | c4e3d66ba5bb6f91a0b5a36bab1123e25623b5e9 (patch) | |
tree | 2cac4fac4512c8c0eccc47d78ad07fd2fea768b9 /src/plugins | |
parent | 2e5489b389c339799c5950f275cbc784927495da (diff) | |
download | weechat-c4e3d66ba5bb6f91a0b5a36bab1123e25623b5e9.zip |
core: add a parent name in options (closes #629)
Inherited values are now displayed in /set output when the value is
null, if a parent option name is defined in option.
New option: weechat.color.chat_value_null
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-server.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index c7ffc1e24..3a5d9d9fc 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -1074,25 +1074,28 @@ irc_server_alloc (const char *name) for (i = 0; i < IRC_SERVER_NUM_OPTIONS; i++) { length = strlen (new_server->name) + 1 + - strlen (irc_server_options[i][0]) + 1; + strlen (irc_server_options[i][0]) + + 512 + /* inherited option name (irc.server_default.xxx) */ + 1; option_name = malloc (length); if (option_name) { - snprintf (option_name, length, "%s.%s", + snprintf (option_name, length, "%s.%s << irc.server_default.%s", new_server->name, + irc_server_options[i][0], irc_server_options[i][0]); - new_server->options[i] = - irc_config_server_new_option (irc_config_file, - irc_config_section_server, - i, - option_name, - NULL, - NULL, - 1, - &irc_config_server_check_value_cb, - irc_server_options[i][0], - &irc_config_server_change_cb, - irc_server_options[i][0]); + new_server->options[i] = irc_config_server_new_option ( + irc_config_file, + irc_config_section_server, + i, + option_name, + NULL, + NULL, + 1, + &irc_config_server_check_value_cb, + irc_server_options[i][0], + &irc_config_server_change_cb, + irc_server_options[i][0]); irc_config_server_change_cb (irc_server_options[i][0], new_server->options[i]); free (option_name); |