summaryrefslogtreecommitdiff
path: root/src/fe-common/core/chat-completion.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-common/core/chat-completion.c')
-rw-r--r--src/fe-common/core/chat-completion.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c
index aba76b9d..c37c77cd 100644
--- a/src/fe-common/core/chat-completion.c
+++ b/src/fe-common/core/chat-completion.c
@@ -40,7 +40,7 @@
static int keep_privates_count, keep_publics_count;
static int completion_lowercase;
-static const char *completion_char, *cmdchars;
+static char *completion_char, *cmdchars;
static GSList *global_lastmsgs;
static int completion_auto, completion_strict;
@@ -1126,11 +1126,16 @@ static void read_settings(void)
keep_privates_count = settings_get_int("completion_keep_privates");
keep_publics_count = settings_get_int("completion_keep_publics");
completion_lowercase = settings_get_bool("completion_nicks_lowercase");
- completion_char = settings_get_str("completion_char");
- cmdchars = settings_get_str("cmdchars");
+
completion_auto = settings_get_bool("completion_auto");
completion_strict = settings_get_bool("completion_strict");
+ g_free_not_null(completion_char);
+ completion_char = g_strdup(settings_get_str("completion_char"));
+
+ g_free_not_null(cmdchars);
+ cmdchars = g_strdup(settings_get_str("cmdchars"));
+
if (*completion_char == '\0') {
/* this would break.. */
completion_auto = FALSE;
@@ -1220,4 +1225,7 @@ void chat_completion_deinit(void)
signal_remove("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
+
+ g_free_not_null(completion_char);
+ g_free_not_null(cmdchars);
}