diff options
author | Volker Lendecke <vl@samba.org> | 2023-02-02 12:25:05 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2023-02-13 20:28:33 +0000 |
commit | 4bbf2b1127b93efe655360a185567de080faa943 (patch) | |
tree | 96aa4cbf12399d0bf25f4266cc0bd9ed679f3402 /source3/lib | |
parent | 6e856074b143ea595f3ab9e5184d21bec11b17ae (diff) | |
download | samba-4bbf2b1127b93efe655360a185567de080faa943.tar.gz |
lib: Simplify ms_has_wild() with strpbrk()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 83707b31e38..9589c8e8bb8 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1443,19 +1443,8 @@ bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent, bool ms_has_wild(const char *s) { - char c; - - while ((c = *s++)) { - switch (c) { - case '*': - case '?': - case '<': - case '>': - case '"': - return True; - } - } - return False; + const char *found = strpbrk(s, "*?<>\""); + return (found != NULL); } bool ms_has_wild_w(const smb_ucs2_t *s) |