This is in many cases redundant, as a similar check is done by various
callers already, but in other cases (where we read the color from a
static table for example), it's nice to let the color check be done by
the table code itself, and since it doesn't hurt in the other cases just
do it again.
if (j > 0)
fputc(' ', f); /* column separator */
- if (d->color)
+ if (d->color && colors_enabled())
fputs(d->color, f);
fputs(field, f);
- if (d->color)
- fputs(ansi_normal(), f);
+ if (d->color && colors_enabled())
+ fputs(ANSI_NORMAL, f);
}
fputc('\n', f);