]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
ls: detect terminal color support using glob patterns
authorPádraig Brady <P@draigBrady.com>
Mon, 19 Oct 2015 11:48:49 +0000 (12:48 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 19 Oct 2015 11:59:09 +0000 (12:59 +0100)
* 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.

src/ls.c

index 7c22b66fd62f5d7e7b5bde7dbdbb413f513c01a9..382253484dde61faac6271f44abe889d674b503b 100644 (file)
--- 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;