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)
This commit is contained in:
Farow 2013-10-04 15:00:07 +03:00 committed by TingPing
parent a47740636d
commit 4ec0e6fd05
1 changed files with 5 additions and 1 deletions

View File

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