From 7942c2826b9f1f16246ef284009572427ec44909 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Mar 2004 23:45:15 +0000 Subject: Merge from HEAD for Amanda group. Apply Craig Barratt's fixes to allow multiple exlusion files and patterns. Jeremy. (This used to be commit 0272fac8ca40b3d4ea4de8ac8a2e371d450d12e6) --- source3/lib/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 3a8d627ee9..10d224baab 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2320,6 +2320,20 @@ BOOL mask_match(const char *string, char *pattern, BOOL is_case_sensitive) return ms_fnmatch(pattern, string, Protocol, is_case_sensitive) == 0; } +/******************************************************************* + A wrapper that handles a list of patters and calls mask_match() + on each. Returns True if any of the patterns match. +*******************************************************************/ + +BOOL mask_match_list(const char *string, char **list, int listLen, BOOL is_case_sensitive) +{ + while (listLen-- > 0) { + if (mask_match(string, *list++, is_case_sensitive)) + return True; + } + return False; +} + /********************************************************* Recursive routine that is called by unix_wild_match. *********************************************************/ -- cgit