diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-04-17 06:35:52 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-04-17 06:35:52 +0000 |
commit | 2534a68cbfbf67a1ce5da61c65b16dc82b34a5d4 (patch) | |
tree | df2cc9a6b8ad130178e965d4d828c518bad40049 | |
parent | afd0f093c8503993fd2f906176f8c408f2154bc9 (diff) | |
download | samba-2534a68cbfbf67a1ce5da61c65b16dc82b34a5d4.tar.gz samba-2534a68cbfbf67a1ce5da61c65b16dc82b34a5d4.tar.xz samba-2534a68cbfbf67a1ce5da61c65b16dc82b34a5d4.zip |
another wfwg wildcard fix
-rw-r--r-- | source/lib/ms_fnmatch.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/lib/ms_fnmatch.c b/source/lib/ms_fnmatch.c index c4ebaf6aa27..b4591c7dbc4 100644 --- a/source/lib/ms_fnmatch.c +++ b/source/lib/ms_fnmatch.c @@ -47,27 +47,30 @@ static int ms_fnmatch_lanman_core(char *pattern, char *string) while ((c = *p++)) { switch (c) { case '.': + if (! *n) goto next; /* if (! *n && ! *p) goto match; */ if (*n != '.') goto nomatch; n++; break; case '?': + if (! *n) goto next; if ((*n == '.' && n[1] != '.') || ! *n) goto next; n++; break; case '>': + if (! *n) goto next; if (n[0] == '.') { if (! n[1] && ms_fnmatch_lanman_core(p, n+1) == 0) goto match; if (ms_fnmatch_lanman_core(p, n) == 0) goto match; goto nomatch; } - if (! *n) goto next; n++; break; case '*': + if (! *n) goto next; if (! *p) goto match; for (; *n; n++) { if (ms_fnmatch_lanman_core(p, n) == 0) goto match; @@ -119,7 +122,7 @@ static int ms_fnmatch_lanman1(char *pattern, char *string) { if (!strpbrk(pattern, "?*<>\"")) { if (strcmp(string,"..") == 0) string = "."; - return strcmp(pattern, string); + return strcasecmp(pattern, string); } if (strcmp(string,"..") == 0 || strcmp(string,".") == 0) { |