lib: Fix "is_case_sensitive" in "ms_fnmatch_protocol"' callers
[samba.git] / source4 / client / client.c
index 10d027b5e0bfe8c40f3ec28fedf80de1544266b8..1182e5be013e0d3586821ff18fe5ed263ac77362 100644 (file)
@@ -302,27 +302,17 @@ static int cmd_cd(struct smbclient_context *ctx, const char **args)
 static bool mask_match(struct smbcli_state *c, const char *string, 
                const char *pattern, bool is_case_sensitive)
 {
-       char *p2, *s2;
-       bool ret;
+       int ret;
 
        if (ISDOTDOT(string))
                string = ".";
        if (ISDOT(pattern))
                return false;
-       
-       if (is_case_sensitive)
-               return ms_fnmatch_protocol(
-                       pattern, string, c->transport->negotiate.protocol,
-                       true) == 0;
-
-       p2 = strlower_talloc(NULL, pattern);
-       s2 = strlower_talloc(NULL, string);
-       ret = ms_fnmatch_protocol(p2, s2, c->transport->negotiate.protocol,
-                                 true) == 0;
-       talloc_free(p2);
-       talloc_free(s2);
-
-       return ret;
+
+       ret = ms_fnmatch_protocol(pattern, string,
+                                 c->transport->negotiate.protocol,
+                                 is_case_sensitive);
+       return (ret == 0);
 }