mirror of
https://github.com/irssi/irssi.git
synced 2026-08-22 18:12:12 +02:00
Merge ccd33d46d4 into 4e8c1548e0
This commit is contained in:
commit
4496824e52
1 changed files with 8 additions and 2 deletions
|
|
@ -1067,8 +1067,9 @@ static const char *get_ansi_color(THEME_REC *theme, const char *str,
|
||||||
/* parse MIRC color string */
|
/* parse MIRC color string */
|
||||||
static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
|
static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
|
||||||
{
|
{
|
||||||
int fg, bg;
|
int fg, bg, hasfg;
|
||||||
|
|
||||||
|
hasfg = 0;
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -1078,6 +1079,7 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
|
||||||
} else {
|
} else {
|
||||||
/* foreground color */
|
/* foreground color */
|
||||||
if (**str != ',') {
|
if (**str != ',') {
|
||||||
|
hasfg = 1;
|
||||||
fg = **str-'0';
|
fg = **str-'0';
|
||||||
(*str)++;
|
(*str)++;
|
||||||
if (i_isdigit(**str)) {
|
if (i_isdigit(**str)) {
|
||||||
|
|
@ -1087,8 +1089,12 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
|
||||||
}
|
}
|
||||||
if (**str == ',') {
|
if (**str == ',') {
|
||||||
/* background color */
|
/* background color */
|
||||||
if (!i_isdigit((*str)[1]))
|
if (!i_isdigit((*str)[1])) {
|
||||||
bg = -1;
|
bg = -1;
|
||||||
|
if (!hasfg) {
|
||||||
|
fg = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
(*str)++;
|
(*str)++;
|
||||||
bg = **str-'0';
|
bg = **str-'0';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue