Merge branch 'pw/maint-p4-rcs-expansion-newline' into maint
[gitweb.git] / compat / fnmatch / fnmatch.c
index 03157a4ab5e4aee407d133e9de58c953265c46a3..0ff1d273a5839d15a908a4ed90b56d59b151e6e0 100644 (file)
@@ -39,7 +39,7 @@
 # include <stdlib.h>
 #endif
 
-/* For platform which support the ISO C amendment 1 functionality we
+/* For platforms which support the ISO C amendment 1 functionality we
    support user defined character classes.  */
 #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
@@ -127,6 +127,10 @@ extern char *getenv ();
 extern int errno;
 # endif
 
+# ifndef NULL
+#  define NULL 0
+# endif
+
 /* This function doesn't exist on most systems.  */
 
 # if !defined HAVE___STRCHRNUL && !defined _LIBC
@@ -341,7 +345,7 @@ internal_fnmatch (pattern, string, no_leading_period, flags)
 
                    for (;;)
                      {
-                       if (c1 == CHAR_CLASS_MAX_LENGTH)
+                       if (c1 > CHAR_CLASS_MAX_LENGTH)
                          /* The name is too long and therefore the pattern
                             is ill-formed.  */
                          return FNM_NOMATCH;