mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 02:33:12 +02:00
Build list of color aliases at startup (fix crash when setting "++1" on option if no palette option is defined)
This commit is contained in:
@@ -448,6 +448,7 @@ gui_color_init ()
|
||||
}
|
||||
gui_color_init_pairs ();
|
||||
gui_color_init_weechat ();
|
||||
gui_color_palette_build_aliases ();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -562,6 +563,12 @@ gui_color_palette_build_aliases ()
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!gui_color_hash_palette_alias || !gui_color_list_with_alias
|
||||
|| !gui_color_hash_palette_color)
|
||||
{
|
||||
gui_color_palette_alloc ();
|
||||
}
|
||||
|
||||
hashtable_remove_all (gui_color_hash_palette_alias);
|
||||
weelist_remove_all (gui_color_list_with_alias);
|
||||
for (i = 0; i < GUI_CURSES_NUM_WEECHAT_COLORS; i++)
|
||||
|
||||
@@ -153,6 +153,7 @@ extern const char *gui_color_get_custom (const char *color_name);
|
||||
extern char *gui_color_decode (const char *string, const char *replacement);
|
||||
extern char *gui_color_string_replace_colors (const char *string);
|
||||
extern void gui_color_free (struct t_gui_color *color);
|
||||
extern void gui_color_palette_alloc ();
|
||||
extern int gui_color_palette_get_alias (const char *alias);
|
||||
extern struct t_gui_color_palette *gui_color_palette_get (int number);
|
||||
extern void gui_color_palette_add (int number, const char *value);
|
||||
|
||||
Reference in New Issue
Block a user