diff options
author | peter <peter@FreeBSD.org> | 1999-12-11 12:24:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-12-11 12:24:21 +0000 |
commit | 784ea5066cbea73d04e8ce5783dd0eb842e3ac1f (patch) | |
tree | 2a59869a343a5d43c01370f1083d67c2a02785a0 /contrib/cvs/lib/fnmatch.c | |
parent | 308b60f66831aa65a459a7b347ea6ca14b6e4799 (diff) | |
download | FreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.zip FreeBSD-src-784ea5066cbea73d04e8ce5783dd0eb842e3ac1f.tar.gz |
Import cvs-1.10.7. There are a number of nasty bugs that have been fixed.
Obtained from: cyclic.com
Diffstat (limited to 'contrib/cvs/lib/fnmatch.c')
-rw-r--r-- | contrib/cvs/lib/fnmatch.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/contrib/cvs/lib/fnmatch.c b/contrib/cvs/lib/fnmatch.c index cf0f124..a41c0dc 100644 --- a/contrib/cvs/lib/fnmatch.c +++ b/contrib/cvs/lib/fnmatch.c @@ -18,14 +18,7 @@ Library General Public License for more details. */ #include "config.h" #endif -/* Some file systems are case-insensitive. If FOLD_FN_CHAR is - #defined, it maps the character C onto its "canonical" form. In a - case-insensitive system, it would map all alphanumeric characters - to lower case. Under Windows NT, / and \ are both path component - separators, so FOLD_FN_CHAR would map them both to /. */ -#ifndef FOLD_FN_CHAR -#define FOLD_FN_CHAR(c) (c) -#endif +#include "system.h" /* IGNORE(@ */ /* #include <ansidecl.h> */ @@ -75,7 +68,7 @@ fnmatch (pattern, string, flags) case '\\': if (!(flags & FNM_NOESCAPE)) c = *p++; - if (*n != c) + if (FOLD_FN_CHAR (*n) != FOLD_FN_CHAR (c)) return FNM_NOMATCH; break; @@ -95,7 +88,7 @@ fnmatch (pattern, string, flags) { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; for (--p; *n != '\0'; ++n) - if ((c == '[' || *n == c1) && + if ((c == '[' || FOLD_FN_CHAR (*n) == FOLD_FN_CHAR (c1)) && fnmatch(p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; |