diff options
-rw-r--r-- | coreutils/ls.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c index df4277fbd..52c43c731 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c | |||
@@ -1222,6 +1222,11 @@ int ls_main(int argc UNUSED_PARAM, char **argv) | |||
1222 | /* set G_show_color = 1/0 */ | 1222 | /* set G_show_color = 1/0 */ |
1223 | if (ENABLE_FEATURE_LS_COLOR_IS_DEFAULT && !is_TERM_dumb()) { | 1223 | if (ENABLE_FEATURE_LS_COLOR_IS_DEFAULT && !is_TERM_dumb()) { |
1224 | char *p = getenv("LS_COLORS"); | 1224 | char *p = getenv("LS_COLORS"); |
1225 | # if ENABLE_PLATFORM_MINGW32 | ||
1226 | /* No colour if unset or empty: https://no-color.org */ | ||
1227 | char *no_c = getenv("NO_COLOR"); | ||
1228 | if (!no_c || no_c[0] == '\0') | ||
1229 | # endif | ||
1225 | /* LS_COLORS is unset, or (not empty && not "none") ? */ | 1230 | /* LS_COLORS is unset, or (not empty && not "none") ? */ |
1226 | if (!p || (p[0] && strcmp(p, "none") != 0)) { | 1231 | if (!p || (p[0] && strcmp(p, "none") != 0)) { |
1227 | if (isatty(STDOUT_FILENO)) { | 1232 | if (isatty(STDOUT_FILENO)) { |