From a253398165d6f18bf60d916f97d69a2ad3619e48 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 8 Feb 2009 19:49:56 +0100 Subject: [PATCH] Fix color decoding function --- src/gui/gui-color.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c index 98e6522b9..8c4e307ef 100644 --- a/src/gui/gui-color.c +++ b/src/gui/gui-color.c @@ -225,16 +225,29 @@ gui_color_decode (const unsigned char *string) string++; switch (string[0]) { - case 'F': - case 'B': + case GUI_COLOR_FG_CHAR: + case GUI_COLOR_BG_CHAR: if (string[1] && string[2]) string += 3; break; - case '*': + case GUI_COLOR_FG_BG_CHAR: if (string[1] && string[2] && (string[3] == ',') && string[4] && string[5]) string += 6; break; + case GUI_COLOR_BAR_CHAR: + string++; + switch (string[0]) + { + case GUI_COLOR_BAR_FG_CHAR: + case GUI_COLOR_BAR_BG_CHAR: + case GUI_COLOR_BAR_DELIM_CHAR: + case GUI_COLOR_BAR_START_INPUT_CHAR: + case GUI_COLOR_BAR_MOVE_CURSOR_CHAR: + string++; + break; + } + break; default: if (isdigit (string[0]) && isdigit (string[1])) string += 2; @@ -257,6 +270,7 @@ gui_color_decode (const unsigned char *string) memcpy (out + out_pos, string, length); out_pos += length; string += length; + break; } } out[out_pos] = '\0';