forked from PsychoticNinja/irssi
Merge pull request #790 from ailin-nemui/mirc-colour
reset colour at comma, like mIRC
This commit is contained in:
commit
5637a8df43
@ -1072,24 +1072,21 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
|
|||||||
fg = fg_ret == NULL ? -1 : *fg_ret;
|
fg = fg_ret == NULL ? -1 : *fg_ret;
|
||||||
bg = bg_ret == NULL ? -1 : *bg_ret;
|
bg = bg_ret == NULL ? -1 : *bg_ret;
|
||||||
|
|
||||||
if (!i_isdigit(**str) && **str != ',') {
|
if (!i_isdigit(**str)) {
|
||||||
|
/* turn off color */
|
||||||
fg = -1;
|
fg = -1;
|
||||||
bg = -1;
|
bg = -1;
|
||||||
} else {
|
} else {
|
||||||
/* foreground color */
|
/* foreground color */
|
||||||
if (**str != ',') {
|
|
||||||
fg = **str-'0';
|
fg = **str-'0';
|
||||||
(*str)++;
|
(*str)++;
|
||||||
if (i_isdigit(**str)) {
|
if (i_isdigit(**str)) {
|
||||||
fg = fg*10 + (**str-'0');
|
fg = fg*10 + (**str-'0');
|
||||||
(*str)++;
|
(*str)++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (**str == ',') {
|
if ((*str)[0] == ',' && i_isdigit((*str)[1])) {
|
||||||
/* background color */
|
/* background color */
|
||||||
if (!i_isdigit((*str)[1]))
|
|
||||||
bg = -1;
|
|
||||||
else {
|
|
||||||
(*str)++;
|
(*str)++;
|
||||||
bg = **str-'0';
|
bg = **str-'0';
|
||||||
(*str)++;
|
(*str)++;
|
||||||
@ -1099,7 +1096,6 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (fg_ret) *fg_ret = fg;
|
if (fg_ret) *fg_ret = fg;
|
||||||
if (bg_ret) *bg_ret = bg;
|
if (bg_ret) *bg_ret = bg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user