summaryrefslogtreecommitdiff
path: root/src/fe-common/core
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2017-11-20 14:17:15 +0100
committerGitHub <noreply@github.com>2017-11-20 14:17:15 +0100
commit47400d405a0680bfe4d69ce8b06ecbfd09931999 (patch)
tree535c862a87717f67455644cacd1b6914ba7b300f /src/fe-common/core
parent3acc72f842a021ffcff8809c1f245ca614f68598 (diff)
downloadirssi-47400d405a0680bfe4d69ce8b06ecbfd09931999.zip
Update formats.c
remove now useless check for ,
Diffstat (limited to 'src/fe-common/core')
-rw-r--r--src/fe-common/core/formats.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/fe-common/core/formats.c b/src/fe-common/core/formats.c
index a340bffa..37db6f7c 100644
--- a/src/fe-common/core/formats.c
+++ b/src/fe-common/core/formats.c
@@ -1078,23 +1078,22 @@ static void get_mirc_color(const char **str, int *fg_ret, int *bg_ret)
bg = -1;
} else {
/* foreground color */
- if (**str != ',') {
- fg = **str-'0';
+ fg = **str-'0';
+ (*str)++;
+ if (i_isdigit(**str)) {
+ fg = fg*10 + (**str-'0');
(*str)++;
- if (i_isdigit(**str)) {
- fg = fg*10 + (**str-'0');
- (*str)++;
- }
}
+
if ((*str)[0] == ',' && i_isdigit((*str)[1])) {
/* background color */
+ (*str)++;
+ bg = **str-'0';
+ (*str)++;
+ if (i_isdigit(**str)) {
+ bg = bg*10 + (**str-'0');
(*str)++;
- bg = **str-'0';
- (*str)++;
- if (i_isdigit(**str)) {
- bg = bg*10 + (**str-'0');
- (*str)++;
- }
+ }
}
}