diff options
author | Jeremy Allison <jra@samba.org> | 1999-07-20 00:52:51 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1999-07-20 00:52:51 +0000 |
commit | 64e102a332e2d272298749e82a2c0d5bf9b3ed76 (patch) | |
tree | 08dbe1bcf5c544b62eb2fd5a3c2fdae3e49b0213 | |
parent | e2f387a1d288b1374b1c7209a7348f3c7e8f2cb7 (diff) | |
download | samba-64e102a332e2d272298749e82a2c0d5bf9b3ed76.tar.gz samba-64e102a332e2d272298749e82a2c0d5bf9b3ed76.tar.xz samba-64e102a332e2d272298749e82a2c0d5bf9b3ed76.zip |
Fixed wierd mask_match bug introduced in new code.
Jeremy.
-rw-r--r-- | source/lib/util.c | 4 | ||||
-rw-r--r-- | source/lib/util_str.c | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index 005834a4234..1c94f881cb7 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -1420,7 +1420,9 @@ BOOL mask_match(char *str, char *regexp, int case_sig,BOOL trans2) * Ugly ! Special case for non-NT. If filename is XXXX and pattern extension * is '*' or all '?' then disallow match. */ - if (*cp2 == '\0' && (ra_type != RA_WINNT) && (strequal(eext, "*") || str_is_all(eext, '?'))) + + if (*cp2 == '\0' && (ra_type != RA_WINNT) && (ra_type != RA_WIN2K) && + (strequal(eext, "*") || str_is_all(eext, '?'))) break; cp1 = rp ? rp + 1 : NULL; diff --git a/source/lib/util_str.c b/source/lib/util_str.c index ed9ea9cb2be..918d6174e7f 100644 --- a/source/lib/util_str.c +++ b/source/lib/util_str.c @@ -739,6 +739,11 @@ Return True if a string consists only of one particular character. BOOL str_is_all(const char *s,char c) { + if(s == NULL) + return False; + if(!*s) + return False; + #if !defined(KANJI_WIN95_COMPATIBILITY) /* * For completeness we should put in equivalent code for code pages @@ -786,6 +791,7 @@ BOOL str_is_all(const char *s,char c) safe string copy into a known length string. maxlength does not include the terminating zero. ********************************************************************/ + char *safe_strcpy(char *dest,const char *src, size_t maxlength) { size_t len; @@ -817,6 +823,7 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength) safe string cat into a string. maxlength does not include the terminating zero. ********************************************************************/ + char *safe_strcat(char *dest, const char *src, size_t maxlength) { size_t src_len, dest_len; |