From: Volker Lendecke Date: Sat, 21 Nov 2009 15:15:16 +0000 (+0100) Subject: s3: Avoid two calls to strcmp() X-Git-Tag: samba-4.0.0alpha9~275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=97525d0a0e7e101cad5cbc218aed7fed982f30cc;p=thirdparty%2Fsamba.git s3: Avoid two calls to strcmp() --- diff --git a/source3/lib/util.c b/source3/lib/util.c index 9d12e5b5609..6348ddc1936 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;