1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Word highlighting was buggy

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1286 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-22 10:52:29 +00:00 committed by cras
parent 95fb3f5623
commit e2ff4550ea

View File

@ -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);
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);