From 4ec0e6fd0525cca22fb28e80caf0c5b473c965b1 Mon Sep 17 00:00:00 2001 From: Farow Date: Fri, 4 Oct 2013 15:00:07 +0300 Subject: libsexy: Improve color parsing - Background colour is only parsed when there's a comma - Offset for background color is incorrectly calculated (there's no control character, just a comma) --- src/fe-gtk/sexy-spell-entry.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c index 85d050d8..42d47127 100644 --- a/src/fe-gtk/sexy-spell-entry.c +++ b/src/fe-gtk/sexy-spell-entry.c @@ -950,6 +950,10 @@ check_color: parsing_color = 5; } + /* don't parse background color without a comma */ + else if (parsing_color == 3 && text[i - 1] != ',') + parsing_color = 5; + switch (parsing_color) { case 1: @@ -965,7 +969,7 @@ check_color: case 3: bg_color[0] = text[i]; parsing_color++; - bg_offset = 3 + fg_offset; /* 1 extra for , */ + bg_offset = 2 + fg_offset; /* 1 extra for , */ continue; case 4: bg_color[1] = text[i]; -- cgit 1.4.1