Fix bug with replacement char in API function string_remove_color (bug #30296)

This commit is contained in:
Sebastien Helleu 2010-07-07 15:44:02 +02:00
parent 869e4448b9
commit 46fdee19b0
2 changed files with 36 additions and 40 deletions

View File

@ -1,7 +1,7 @@
WeeChat ChangeLog WeeChat ChangeLog
================= =================
Sébastien Helleu <flashcode@flashtux.org> Sébastien Helleu <flashcode@flashtux.org>
v0.3.3-dev, 2010-07-06 v0.3.3-dev, 2010-07-07
Version 0.3.3 (under dev!) Version 0.3.3 (under dev!)
@ -17,6 +17,8 @@ Version 0.3.3 (under dev!)
process) process)
* core: fix display bug with attributes like underlined in bars (bug #29889) * core: fix display bug with attributes like underlined in bars (bug #29889)
* core: add hashtables with new functions in plugin API * core: add hashtables with new functions in plugin API
* api: fix bug with replacement char in function string_remove_color
(bug #30296)
* api: add function "string_expand_home", fix bug with replacement of home in * api: add function "string_expand_home", fix bug with replacement of home in
paths paths
* irc: fix display of local SSL certificate when it is sent to server * irc: fix display of local SSL certificate when it is sent to server

View File

@ -267,13 +267,6 @@ gui_color_decode (const char *string, const char *replacement)
{ {
case GUI_COLOR_COLOR_CHAR: case GUI_COLOR_COLOR_CHAR:
ptr_string++; ptr_string++;
if (replacement && replacement[0])
{
out[out_pos] = replacement[0];
out_pos++;
}
else
{
switch (ptr_string[0]) switch (ptr_string[0])
{ {
case GUI_COLOR_FG_CHAR: case GUI_COLOR_FG_CHAR:
@ -305,20 +298,21 @@ gui_color_decode (const char *string, const char *replacement)
ptr_string += 2; ptr_string += 2;
break; break;
} }
}
break;
case GUI_COLOR_SET_WEECHAT_CHAR:
case GUI_COLOR_REMOVE_WEECHAT_CHAR:
ptr_string++;
if (replacement && replacement[0]) if (replacement && replacement[0])
{ {
out[out_pos] = replacement[0]; out[out_pos] = replacement[0];
out_pos++; out_pos++;
} }
else break;
{ case GUI_COLOR_SET_WEECHAT_CHAR:
case GUI_COLOR_REMOVE_WEECHAT_CHAR:
ptr_string++;
if (ptr_string[0]) if (ptr_string[0])
ptr_string++; ptr_string++;
if (replacement && replacement[0])
{
out[out_pos] = replacement[0];
out_pos++;
} }
break; break;
case GUI_COLOR_RESET_CHAR: case GUI_COLOR_RESET_CHAR: