diff options
-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; |