diff --git a/src/rcfile.c b/src/rcfile.c index 9676a992..d21e814d 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -1041,19 +1041,18 @@ short color_to_short(const char *colorname, bool *vivid, bool *thick) * Return FALSE when any color name is invalid; otherwise return TRUE. */ bool parse_combination(char *combostr, short *fg, short *bg, int *attributes) { - char *comma = strchr(combostr, ','); bool vivid, thick; + char *comma; *attributes = A_NORMAL; if (strncmp(combostr, "bold", 4) == 0) { - *attributes = A_BOLD; + *attributes |= A_BOLD; if (combostr[4] != ',') { jot_error(N_("An attribute requires a subsequent comma")); return FALSE; } combostr += 5; - comma = strchr(combostr, ','); } if (strncmp(combostr, "italic", 6) == 0) { @@ -1063,9 +1062,10 @@ bool parse_combination(char *combostr, short *fg, short *bg, int *attributes) return FALSE; } combostr += 7; - comma = strchr(combostr, ','); } + comma = strchr(combostr, ','); + if (comma != NULL) { *bg = color_to_short(comma + 1, &vivid, &thick); if (*bg == BAD_COLOR)