mirror of
https://github.com/weechat/weechat.git
synced 2026-07-02 07:46:38 +02:00
Fix crash with config reload and bug with empty key section (no more keys after reload if weechat.conf was deleted) (bug #23514)
This commit is contained in:
@@ -499,10 +499,10 @@ config_weechat_reload (void *data, struct t_config_file *config_file)
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) config_file;
|
||||
|
||||
/* remove all keys */
|
||||
gui_keyboard_free_all (&gui_keys, &last_gui_key);
|
||||
gui_keyboard_default_bindings ();
|
||||
|
||||
/* remove all bars */
|
||||
gui_bar_free_all ();
|
||||
@@ -510,7 +510,7 @@ config_weechat_reload (void *data, struct t_config_file *config_file)
|
||||
/* remove all filters */
|
||||
gui_filter_free_all ();
|
||||
|
||||
rc = config_file_reload (weechat_config_file);
|
||||
rc = config_file_reload (config_file);
|
||||
|
||||
if (rc == WEECHAT_CONFIG_READ_OK)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,9 @@ logger_config_read ()
|
||||
{
|
||||
long number;
|
||||
char *string, *error;
|
||||
|
||||
|
||||
if (logger_option_path)
|
||||
free (logger_option_path);
|
||||
logger_option_path = weechat_config_get_plugin (LOGGER_OPTION_PATH);
|
||||
if (!logger_option_path)
|
||||
{
|
||||
@@ -86,6 +88,8 @@ logger_config_read ()
|
||||
LOGGER_DEFAULT_OPTION_PATH);
|
||||
logger_option_path = weechat_config_get_plugin ("path");
|
||||
}
|
||||
if (logger_option_path)
|
||||
logger_option_path = strdup (logger_option_path);
|
||||
|
||||
string = weechat_config_get_plugin (LOGGER_OPTION_NAME_LOWER_CASE);
|
||||
if (!string)
|
||||
@@ -98,7 +102,9 @@ logger_config_read ()
|
||||
logger_option_name_lower_case = 1;
|
||||
else
|
||||
logger_option_name_lower_case = 0;
|
||||
|
||||
|
||||
if (logger_option_time_format)
|
||||
free (logger_option_time_format);
|
||||
logger_option_time_format = weechat_config_get_plugin (LOGGER_OPTION_TIME_FORMAT);
|
||||
if (!logger_option_time_format)
|
||||
{
|
||||
@@ -106,6 +112,8 @@ logger_config_read ()
|
||||
LOGGER_DEFAULT_OPTION_TIME_FORMAT);
|
||||
logger_option_time_format = weechat_config_get_plugin (LOGGER_OPTION_TIME_FORMAT);
|
||||
}
|
||||
if (logger_option_time_format)
|
||||
logger_option_time_format = strdup (logger_option_time_format);
|
||||
|
||||
string = weechat_config_get_plugin (LOGGER_OPTION_INFO_LINES);
|
||||
if (!string)
|
||||
@@ -719,5 +727,10 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
|
||||
|
||||
logger_stop_all ();
|
||||
|
||||
if (logger_option_path)
|
||||
free (logger_option_path);
|
||||
if (logger_option_time_format)
|
||||
free (logger_option_time_format);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user