diff options
Diffstat (limited to 'Source/kwsys/Terminal.c')
-rw-r--r-- | Source/kwsys/Terminal.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index 9409d1b..57a68bf 100644 --- a/Source/kwsys/Terminal.c +++ b/Source/kwsys/Terminal.c @@ -167,12 +167,19 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100, /* Force color according to http://bixense.com/clicolors/ convention. */ { const char* clicolor_force = getenv("CLICOLOR_FORCE"); - if (clicolor_force && *clicolor_force && - strcmp(clicolor_force, "0") != 0) { + if (clicolor_force && strcmp(clicolor_force, "0") != 0) { return 1; } } + /* Disable color according to http://bixense.com/clicolors/ convention. */ + { + const char* clicolor = getenv("CLICOLOR"); + if (clicolor && strcmp(clicolor, "0") == 0) { + return 0; + } + } + /* GNU make 4.1+ may tell us that its output is destined for a TTY. */ { const char* termout = getenv("MAKE_TERMOUT"); |