diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-02-13 18:37:43 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-02-16 13:16:45 -0500 |
commit | bceccd5ecc393c344ab008737ba6aab211a5ea9f (patch) | |
tree | ce4ef4ed45bb54764fe6703372477103c4fad01d /src/shared/strv.c | |
parent | 488c8d08c322471f2e702e25b75f31bed7ae5975 (diff) |
Add helper for fnmatch over strv
Diffstat (limited to 'src/shared/strv.c')
-rw-r--r-- | src/shared/strv.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/strv.c b/src/shared/strv.c index e418312d52..2268bf61db 100644 --- a/src/shared/strv.c +++ b/src/shared/strv.c @@ -692,3 +692,13 @@ char **strv_reverse(char **l) { return l; } + +bool strv_fnmatch(const char *s, char* const* patterns, int flags) { + char* const* p; + + STRV_FOREACH(p, patterns) + if (fnmatch(*p, s, 0) == 0) + return true; + + return false; +} |