coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] ls: detect terminal color support using glob patterns


From: Pádraig Brady
Subject: [PATCH] ls: detect terminal color support using glob patterns
Date: Mon, 19 Oct 2015 13:00:04 +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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ls.c b/src/ls.c
index 7c22b66..3822534 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;
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]