diff options
Diffstat (limited to 'lib/wordfnmatch.c')
-rw-r--r-- | lib/wordfnmatch.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/wordfnmatch.c b/lib/wordfnmatch.c index 73fad8e1..613035b2 100644 --- a/lib/wordfnmatch.c +++ b/lib/wordfnmatch.c @@ -32,19 +32,19 @@ #include "manconfig.h" -#include "lower.h" #include "wordfnmatch.h" /* TODO: How on earth do we allow multiple-word matches without * reimplementing fnmatch()? */ -bool word_fnmatch (const char *lowpattern, const char *string) +bool word_fnmatch (const char *pattern, const char *string) { - char *lowstring = lower (string); - char *begin = lowstring, *p; + char *dupstring = xstrdup (string); + const char *begin = dupstring; + char *p; - for (p = lowstring; *p; p++) { - if (CTYPE (islower, *p) || *p == '_') + for (p = dupstring; *p; p++) { + if (CTYPE (isalpha, *p) || *p == '_') continue; /* Check for multiple non-word characters in a row. */ @@ -52,14 +52,14 @@ bool word_fnmatch (const char *lowpattern, const char *string) begin++; else { *p = '\0'; - if (fnmatch (lowpattern, begin, 0) == 0) { - free (lowstring); + if (fnmatch (pattern, begin, FNM_CASEFOLD) == 0) { + free (dupstring); return true; } begin = p + 1; } } - free (lowstring); + free (dupstring); return false; } |