diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-08-06 20:33:31 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-08-06 20:33:31 +0200 |
commit | 20866a045788cca295892cbff33c84c99f7581af (patch) | |
tree | 164c3f2f2548abab7901443e42ac6471b9d09f3f /src/gui | |
parent | 79d50837c91ffe5920f4e3c0f2b380169a7b2a2f (diff) | |
download | weechat-20866a045788cca295892cbff33c84c99f7581af.zip |
core: fix decoding of attributes in basic ANSI colors (closes #1678)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui-color.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index aee0d8199..80fe1e5d7 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -1036,8 +1036,10 @@ gui_color_decode_ansi_cb (void *data, const char *text) case 35: case 36: case 37: - strcat (output, - gui_color_get_custom (gui_color_ansi[value - 30])); + snprintf (str_color, sizeof (str_color), + "|%s", + gui_color_ansi[value - 30]); + strcat (output, gui_color_get_custom (str_color)); break; case 38: /* text color */ if (i + 1 < num_items) @@ -1128,8 +1130,10 @@ gui_color_decode_ansi_cb (void *data, const char *text) case 95: case 96: case 97: - strcat (output, - gui_color_get_custom (gui_color_ansi[value - 90 + 8])); + snprintf (str_color, sizeof (str_color), + "|%s", + gui_color_ansi[value - 90 + 8]); + strcat (output, gui_color_get_custom (str_color)); break; case 100: /* background color (bright) */ case 101: |