BIG patch... so I am going to provide general comments.
Firstly, header for color.c is wrong, color.h is missing.
And here is the big one. There is a LOT of code "duplication". I say
"duplication" because some of the functions have diverged in the time
this patch has been around so they are no longer duplicates. That
should be an obvious maintenance burden we want to avoid.
An example:
color_yesno() vs. yesno():
- the only difference is the call to color_question() rather question()
then
color_question() vs. question():
- calls color_vfprintf() rather than vfprintf()
So, lets reduce this a lot.
I see that color_vfprintf falls back to just a standard vfprintf when
the "colors" variable is NULL. So we can just call this whenever this
is needed and pass NULL... in fact... see comment on the test below.
If similar things were done so that printf_color() etc all just fell
through to the non-colour version, the whole patchset could just be
printf -> printf_color changes.