diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-02-01 16:45:43 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-02-01 16:45:43 +0100 |
commit | b2c5a94e5dde1aa5775b9fa18616b901736ae928 (patch) | |
tree | b7d1356ee7be0927c32f9cac0a32ed60031daa72 /src/gui | |
parent | c3aa3efac82b265a814664101423b66936d607b1 (diff) | |
download | weechat-b2c5a94e5dde1aa5775b9fa18616b901736ae928.zip |
Fixed bug with prefixes in config file
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-chat.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c index ac7338b34..1910c0f03 100644 --- a/src/gui/gui-chat.c +++ b/src/gui/gui-chat.c @@ -56,12 +56,12 @@ int gui_chat_time_length = 0; /* length of time for each line (in chars) */ void gui_chat_prefix_build_empty () { - gui_chat_prefix[GUI_CHAT_PREFIX_INFO] = gui_chat_prefix_empty; - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR] = gui_chat_prefix_empty; - gui_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = gui_chat_prefix_empty; - gui_chat_prefix[GUI_CHAT_PREFIX_ACTION] = gui_chat_prefix_empty; - gui_chat_prefix[GUI_CHAT_PREFIX_JOIN] = gui_chat_prefix_empty; - gui_chat_prefix[GUI_CHAT_PREFIX_QUIT] = gui_chat_prefix_empty; + gui_chat_prefix[GUI_CHAT_PREFIX_INFO] = strdup (gui_chat_prefix_empty); + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR] = strdup (gui_chat_prefix_empty); + gui_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = strdup (gui_chat_prefix_empty); + gui_chat_prefix[GUI_CHAT_PREFIX_ACTION] = strdup (gui_chat_prefix_empty); + gui_chat_prefix[GUI_CHAT_PREFIX_JOIN] = strdup (gui_chat_prefix_empty); + gui_chat_prefix[GUI_CHAT_PREFIX_QUIT] = strdup (gui_chat_prefix_empty); } /* @@ -73,6 +73,16 @@ void gui_chat_prefix_build () { char prefix[128]; + int i; + + for (i = 0; i < GUI_CHAT_PREFIX_NUMBER; i++) + { + if (gui_chat_prefix[i]) + { + free (gui_chat_prefix[i]); + gui_chat_prefix[i] = NULL; + } + } snprintf (prefix, sizeof (prefix), "%s%s\t", GUI_COLOR(GUI_COLOR_CHAT_PREFIX_INFO), |