diff options
author | Jeremy Allison <jra@samba.org> | 1998-05-26 19:37:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-05-26 19:37:31 +0000 |
commit | 1d16f750515bcf49e0dc87394479dc56e7192538 (patch) | |
tree | 43dc3e4498e941ffa44bec5801dc9b14643c91ff /source3/lib | |
parent | 863c787b020eaf2dc648f51087f5ce3d2c82ab2c (diff) | |
download | samba-1d16f750515bcf49e0dc87394479dc56e7192538.tar.gz samba-1d16f750515bcf49e0dc87394479dc56e7192538.tar.bz2 samba-1d16f750515bcf49e0dc87394479dc56e7192538.zip |
smb.h: More NT SMB stuff (just defines).
smbpass.c: Do *NOT* make this function static. It breaks the compile on gcc
util.c: Getting closer to MS wildcard semantics. A trailing '*' matches
any trailing dot-separated components.
trans2.c: Removed hacks that change multiple '?' -> '*' as this
breaks things now.
trans2.h: Removed NT_FILE_ATTRIBUTE_NORMAL - now FILE_ATTRIBUTE_NORMAL is defined
in smb.h.
Jeremy.
(This used to be commit 42a65511068cd9006350c80bbed2f346f3f01cb0)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index ebf66c56f4..98cd150d7f 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3103,6 +3103,7 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2) * characters. */ char *fp, *rp, *cp2, *cp1; + BOOL last_wcard_was_star = False; matched = False; for( cp1 = ebase, cp2 = sbase; cp1;) { fp = strchr(cp2, '.'); @@ -3111,12 +3112,17 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2) rp = strchr(cp1, '.'); if(rp) *rp = '\0'; + + if(cp1[strlen(cp1)-1] == '*') + last_wcard_was_star = True; + else + last_wcard_was_star = False; if(!do_match(cp2, cp1, case_sig)) break; cp2 = fp ? fp + 1 : ""; cp1 = rp ? rp + 1 : NULL; } - if(cp1 == NULL) + if(cp1 == NULL && ((*cp2 == '\0') || last_wcard_was_star)) matched = True; } else { matched = do_match(sbase,ebase,case_sig) && do_match(sext,eext,case_sig); |