diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-08 19:49:56 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-02-08 19:49:56 +0100 |
commit | a253398165d6f18bf60d916f97d69a2ad3619e48 (patch) | |
tree | 03d87e7e60000e398ceac99679fbb4756bce49f5 | |
parent | 2fce36c2aded643452c097ab184f31e9f8d90201 (diff) | |
download | weechat-a253398165d6f18bf60d916f97d69a2ad3619e48.zip |
Fix color decoding function
-rw-r--r-- | src/gui/gui-color.c | 20 |
1 files 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'; |