diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-18 23:45:15 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-18 23:45:15 +0000 |
commit | 7942c2826b9f1f16246ef284009572427ec44909 (patch) | |
tree | 6fc8c84902831888d9ff5c79e9482064edc9971e /source3/lib | |
parent | 357998ddbdeb2fae0a30c578e747154fec22c180 (diff) | |
download | samba-7942c2826b9f1f16246ef284009572427ec44909.tar.gz samba-7942c2826b9f1f16246ef284009572427ec44909.tar.xz samba-7942c2826b9f1f16246ef284009572427ec44909.zip |
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)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 3a8d627ee9e..10d224baabf 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. *********************************************************/ |