diff options
author | Anton Danilov <littlesmilingcloud@gmail.com> | 2020-07-09 18:03:43 +0300 |
---|---|---|
committer | Stephen Hemminger <stephen@networkplumber.org> | 2020-07-20 13:29:55 -0700 |
commit | 8f5a602f7afce40fcb988316157dbc45ebbf491d (patch) | |
tree | e072d0cc44d33d0ed1530a071ad43fe98a69b72c /misc | |
parent | 66702fb9baf277b2eb6d44a7983d5333ca2a0a2c (diff) | |
download | iproute2-8f5a602f7afce40fcb988316157dbc45ebbf491d.tar.gz |
misc: make the pattern matching case-insensitive
To improve the usability better use case-insensitive pattern-matching
in ifstat, nstat and ss tools.
Signed-off-by: Anton Danilov <littlesmilingcloud@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/ifstat.c | 2 | ||||
-rw-r--r-- | misc/nstat.c | 2 | ||||
-rw-r--r-- | misc/ss.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/misc/ifstat.c b/misc/ifstat.c index 60efe6cb..03327af8 100644 --- a/misc/ifstat.c +++ b/misc/ifstat.c @@ -104,7 +104,7 @@ static int match(const char *id) return 1; for (i = 0; i < npatterns; i++) { - if (!fnmatch(patterns[i], id, 0)) + if (!fnmatch(patterns[i], id, FNM_CASEFOLD)) return 1; } return 0; diff --git a/misc/nstat.c b/misc/nstat.c index 425e75ef..88f52eaf 100644 --- a/misc/nstat.c +++ b/misc/nstat.c @@ -114,7 +114,7 @@ static int match(const char *id) return 1; for (i = 0; i < npatterns; i++) { - if (!fnmatch(patterns[i], id, 0)) + if (!fnmatch(patterns[i], id, FNM_CASEFOLD)) return 1; } return 0; @@ -1670,7 +1670,7 @@ static int unix_match(const inet_prefix *a, const inet_prefix *p) return 1; if (addr == NULL) addr = ""; - return !fnmatch(pattern, addr, 0); + return !fnmatch(pattern, addr, FNM_CASEFOLD); } static int run_ssfilter(struct ssfilter *f, struct sockstat *s) |