-/*
+/*
Unix SMB/CIFS implementation.
filename matching routine
Copyright (C) Andrew Tridgell 1992-2004
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
This module was originally based on fnmatch.c copyright by the Free
Software Foundation. It bears little (if any) resemblence to that
code now
-*/
+*/
/**
* @file
an optimisation only. The ldot pointer is NULL if the string does
not contain a '.', otherwise it points at the last dot in 'n'.
*/
-static int ms_fnmatch_core(const char *p, const char *n,
+static int ms_fnmatch_core(const char *p, const char *n,
struct max_n *max_n, const char *ldot,
bool is_case_sensitive)
{
break;
}
}
-
+
if (! *n) {
return 0;
}
-
+
return -1;
}
for (i=0;p[i];i++) {
if (p[i] == '?') {
p[i] = '>';
- } else if (p[i] == '.' &&
- (p[i+1] == '?' ||
+ } else if (p[i] == '.' &&
+ (p[i+1] == '?' ||
p[i+1] == '*' ||
p[i+1] == 0)) {
p[i] = '"';
- } else if (p[i] == '*' &&
+ } else if (p[i] == '*' &&
p[i+1] == '.') {
p[i] = '<';
}