summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-10-19 12:48:49 +0100
committerPádraig Brady <P@draigBrady.com>2015-10-19 12:59:09 +0100
commit069961924efb64349914df085d6b0ac76bdaf7ae (patch)
tree85492ac50db1e157f68b2897fee78fc659cfe549
parent31b3db53da0a40afa0e98f4f39592057ccd69029 (diff)
downloadcoreutils-069961924efb64349914df085d6b0ac76bdaf7ae.tar.xz
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.
-rw-r--r--src/ls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ls.c b/src/ls.c
index 7c22b66fd..382253484 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;