From 97525d0a0e7e101cad5cbc218aed7fed982f30cc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 21 Nov 2009 16:15:16 +0100 Subject: s3: Avoid two calls to strcmp() --- source3/lib/util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/lib/util.c b/source3/lib/util.c index 9d12e5b560..6348ddc193 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2386,9 +2386,9 @@ bool ms_has_wild_w(const smb_ucs2_t *s) bool mask_match(const char *string, const char *pattern, bool is_case_sensitive) { - if (strcmp(string,"..") == 0) + if (ISDOTDOT(string)) string = "."; - if (strcmp(pattern,".") == 0) + if (ISDOT(pattern)) return False; return ms_fnmatch(pattern, string, Protocol <= PROTOCOL_LANMAN2, is_case_sensitive) == 0; @@ -2402,9 +2402,9 @@ bool mask_match(const char *string, const char *pattern, bool is_case_sensitive) bool mask_match_search(const char *string, const char *pattern, bool is_case_sensitive) { - if (strcmp(string,"..") == 0) + if (ISDOTDOT(string)) string = "."; - if (strcmp(pattern,".") == 0) + if (ISDOT(pattern)) return False; return ms_fnmatch(pattern, string, True, is_case_sensitive) == 0; -- cgit