1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

Fix crash on /upgrade if there are some nicks in a nicklist without prefix or prefix_color defined

This commit is contained in:
Sebastien Helleu
2010-03-24 10:14:10 +01:00
parent 3e2943a0e0
commit b932f403a5
+39 -30
View File
@@ -1187,31 +1187,37 @@ gui_bar_item_default_buffer_nicklist (void *data, struct t_gui_bar_item *item,
strcat (buf, " ");
}
}
if (strchr (ptr_nick->prefix_color, '.'))
if (ptr_nick->prefix_color)
{
config_file_search_with_string (ptr_nick->prefix_color,
NULL, NULL, &ptr_option,
NULL);
if (ptr_option)
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
}
else
{
strcat (buf, gui_color_get_custom (ptr_nick->prefix_color));
if (strchr (ptr_nick->prefix_color, '.'))
{
config_file_search_with_string (ptr_nick->prefix_color,
NULL, NULL, &ptr_option,
NULL);
if (ptr_option)
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
}
else
{
strcat (buf, gui_color_get_custom (ptr_nick->prefix_color));
}
}
if (ptr_nick->prefix)
strcat (buf, ptr_nick->prefix);
if (strchr (ptr_nick->color, '.'))
if (ptr_nick->color)
{
config_file_search_with_string (ptr_nick->color,
NULL, NULL, &ptr_option,
NULL);
if (ptr_option)
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
}
else
{
strcat (buf, gui_color_get_custom (ptr_nick->color));
if (strchr (ptr_nick->color, '.'))
{
config_file_search_with_string (ptr_nick->color,
NULL, NULL, &ptr_option,
NULL);
if (ptr_option)
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
}
else
{
strcat (buf, gui_color_get_custom (ptr_nick->color));
}
}
strcat (buf, ptr_nick->name);
}
@@ -1221,17 +1227,20 @@ gui_bar_item_default_buffer_nicklist (void *data, struct t_gui_bar_item *item,
{
strcat (buf, " ");
}
if (strchr (ptr_group->color, '.'))
if (ptr_group->color)
{
config_file_search_with_string (ptr_group->color,
NULL, NULL, &ptr_option,
NULL);
if (ptr_option)
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
}
else
{
strcat (buf, gui_color_get_custom (ptr_group->color));
if (strchr (ptr_group->color, '.'))
{
config_file_search_with_string (ptr_group->color,
NULL, NULL, &ptr_option,
NULL);
if (ptr_option)
strcat (buf, gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(ptr_option))));
}
else
{
strcat (buf, gui_color_get_custom (ptr_group->color));
}
}
strcat (buf, gui_nicklist_get_group_start (ptr_group->name));
}