diff options
author | Timo Sirainen <cras@irssi.org> | 2001-02-22 10:52:29 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-02-22 10:52:29 +0000 |
commit | e2ff4550ea1c77c95db91ebb07eeea8f174e33dc (patch) | |
tree | f49a7cbba69ba16733d7267a047656f53aa6161c /src | |
parent | 95fb3f5623f606b71c6e7d3bcd2527f23345f330 (diff) | |
download | irssi-e2ff4550ea1c77c95db91ebb07eeea8f174e33dc.zip |
Word highlighting was buggy
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1286 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/hilight-text.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index a506549b..da7b19a7 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -447,12 +447,17 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *str) /* end of the line */ pos = strip_real_length(str, next_hilight_end, &color_pos, &color_len); - if (color_pos > 0) { + if (color_pos > 0) lastcolor = g_strndup(str+color_pos, color_len); - g_string_append(tmp, lastcolor); - g_string_append(tmp, str+pos); - g_free(lastcolor); + else { + /* no colors in line, change back to default */ + lastcolor = g_malloc0(3); + lastcolor[0] = 4; + lastcolor[1] = FORMAT_STYLE_DEFAULTS; } + g_string_append(tmp, lastcolor); + g_string_append(tmp, str+pos); + g_free(lastcolor); newstr = tmp->str; g_string_free(tmp, FALSE); |