From: Pádraig Brady Date: Mon, 19 Oct 2015 11:48:49 +0000 (+0100) Subject: ls: detect terminal color support using glob patterns X-Git-Tag: v8.25~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=069961924efb64349914df085d6b0ac76bdaf7ae;p=thirdparty%2Fcoreutils.git ls: detect terminal color support using glob patterns * src/ls.c (know_term_type): Corresponding to commit v8.24-48-gc249a5a, use fnmatch to inspect the dircolors database. Noticed due to failing tests/ls/color-{dtype-dir,term}.sh tests. --- diff --git a/src/ls.c b/src/ls.c index 7c22b66fd6..382253484d 100644 --- a/src/ls.c +++ b/src/ls.c @@ -2341,7 +2341,7 @@ known_term_type (void) { if (STRNCMP_LIT (line, "TERM ") == 0) { - if (STREQ (term, line + 5)) + if (fnmatch (line + 5, term, 0) == 0) return true; } line += strlen (line) + 1;