Date: Sat, 28 Aug 2021 08:21:04 GMT From: Piotr Pawel Stefaniak <pstef@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: ff5f61e07d70 - stable/13 - ls: prevent no-color build from complaining when COLORTERM is non-empty Message-ID: <202108280821.17S8L42i033670@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=ff5f61e07d70dda34afeac4505db28d72dcad2b1 commit ff5f61e07d70dda34afeac4505db28d72dcad2b1 Author: Piotr Pawel Stefaniak <pstef@FreeBSD.org> AuthorDate: 2021-08-18 20:47:37 +0000 Commit: Piotr Pawel Stefaniak <pstef@FreeBSD.org> CommitDate: 2021-08-28 08:17:55 +0000 ls: prevent no-color build from complaining when COLORTERM is non-empty (cherry picked from commit ced2dcadccfcff8f7991b3cb5f6f70d6710eadfb) --- bin/ls/ls.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 338b3d1d2a26..92575711251d 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -105,9 +105,7 @@ static void traverse(int, char **, int); static const struct option long_opts[] = { -#ifdef COLORLS {"color", optional_argument, NULL, COLOR_OPT}, -#endif {NULL, no_argument, NULL, 0} }; @@ -448,8 +446,8 @@ main(int argc, char *argv[]) case 'y': f_samesort = 1; break; -#ifdef COLORLS case COLOR_OPT: +#ifdef COLORLS if (optarg == NULL || do_color_always(optarg)) colorflag = COLORFLAG_ALWAYS; else if (do_color_auto(optarg)) @@ -460,6 +458,8 @@ main(int argc, char *argv[]) errx(2, "unsupported --color value '%s' (must be always, auto, or never)", optarg); break; +#else + warnx("color support not compiled in"); #endif default: case '?': @@ -503,8 +503,6 @@ main(int argc, char *argv[]) f_color = 1; explicitansi = true; } -#else - warnx("color support not compiled in"); #endif /*COLORLS*/ }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108280821.17S8L42i033670>