summaryrefslogtreecommitdiff
path: root/src/dircolors.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-10-13 12:40:52 +0100
committerPádraig Brady <P@draigBrady.com>2015-10-16 12:23:30 +0100
commitc249a5afc4f480e10346198422a3161931afd574 (patch)
treefd799462c026bdba9c8c577ceba8799335054457 /src/dircolors.c
parent3a68c3e99065fd17436260889fe821caa19a855e (diff)
downloadcoreutils-c249a5afc4f480e10346198422a3161931afd574.tar.xz
dircolors: support globbing of TERM entries
* src/dircolors.c (dc_parse_stream): Support globbing of TERM entries, to allow entries like "TERM *256color*" for example. * src/dircolors.hin: Reduce the internal list with globbing. * tests/misc/dircolors.pl: New test cases. * NEWS: Mention the improvement.
Diffstat (limited to 'src/dircolors.c')
-rw-r--r--src/dircolors.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dircolors.c b/src/dircolors.c
index 3a03f1f22..d0bd2e406 100644
--- a/src/dircolors.c
+++ b/src/dircolors.c
@@ -18,6 +18,7 @@
#include <config.h>
#include <sys/types.h>
+#include <fnmatch.h>
#include <getopt.h>
#include "system.h"
@@ -293,7 +294,7 @@ dc_parse_stream (FILE *fp, const char *filename)
unrecognized = false;
if (c_strcasecmp (keywd, "TERM") == 0)
{
- if (STREQ (arg, term))
+ if (fnmatch (arg, term, 0) == 0)
state = ST_TERMSURE;
else if (state != ST_TERMSURE)
state = ST_TERMNO;