Browse Source

(FOLD): Do not assume that characters are unsigned.

Paul Eggert 24 years ago
parent
commit
731cf2666a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/fnmatch.c

+ 3 - 1
lib/fnmatch.c

@@ -61,7 +61,9 @@ fnmatch (const char *pattern, const char *string, int flags)
   register char c;
 
 /* Note that this evaluates C many times.  */
-# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
+# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER ((unsigned char) (c)) \
+                  ? tolower ((unsigned char) (c)) \
+                  : (c))
 
   while ((c = *p++) != '\0')
     {