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
This commit is contained in:
Kyle Evans 2020-05-21 15:15:50 +00:00
parent a408dc2018
commit 151a7e1135
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=361332

View File

@ -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;