Skip to content

Commit

Permalink
fix A_NORMAL :color dump
Browse files Browse the repository at this point in the history
When the colour is 0 (A_NORMAL), don't display "normal" for the attribute.
  • Loading branch information
flatcap committed Nov 4, 2023
1 parent aa0e273 commit 44812af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions color/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,13 @@ const char *color_log_attrs_list(int attrs)

text[0] = '\0';
int pos = 0;
// We can ignore the A_NORMAL case
if (attrs & A_BLINK)
pos += snprintf(text + pos, sizeof(text) - pos, "blink ");
if (attrs & A_BOLD)
pos += snprintf(text + pos, sizeof(text) - pos, "bold ");
if (attrs & A_ITALIC)
pos += snprintf(text + pos, sizeof(text) - pos, "italic ");
if (attrs == A_NORMAL)
pos += snprintf(text + pos, sizeof(text) - pos, "normal ");
if (attrs & A_REVERSE)
pos += snprintf(text + pos, sizeof(text) - pos, "reverse ");
if (attrs & A_STANDOUT)
Expand Down

0 comments on commit 44812af

Please sign in to comment.