summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/hilight-text.c13
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);