From 151a7e11350a4157acb1a2a142fe30a2c1f5712e Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 21 May 2020 15:15:50 +0000 Subject: [PATCH] ls: fix WITHOUT_LS_COLORS build *sigh* references to colorflags should be gated by COLORLS. Pointy hat to: kevans Reported by: jenkins (rescue build) X-MFC-With: r361318 --- bin/ls/ls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index edf4b49bf0e8..7378268867ef 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -270,8 +270,10 @@ main(int argc, char *argv[]) * For historical compatibility, we'll use our autodetection if CLICOLOR * is set. */ +#ifdef COLORLS if (getenv("CLICOLOR")) colorflag = COLORFLAG_AUTO; +#endif while ((ch = getopt_long(argc, argv, "+1ABCD:FGHILPRSTUWXZabcdfghiklmnopqrstuwxy,", long_opts, NULL)) != -1) { @@ -355,7 +357,9 @@ main(int argc, char *argv[]) * stdout isn't a tty. */ setenv("CLICOLOR", "", 1); +#ifdef COLORLS colorflag = COLORFLAG_AUTO; +#endif break; case 'H': fts_options |= FTS_COMFOLLOW;