Here's a simple fix.  I've matched the indent style of the existing
code.

 - todd

Index: lib/libc/gen/fnmatch.c
===================================================================
RCS file: /cvs/src/lib/libc/gen/fnmatch.c,v
retrieving revision 1.19
diff -u -p -u -r1.19 fnmatch.c
--- lib/libc/gen/fnmatch.c      1 Aug 2015 18:11:08 -0000       1.19
+++ lib/libc/gen/fnmatch.c      26 Feb 2016 17:47:24 -0000
@@ -187,11 +187,17 @@ static int fnmatch_ch(const char **patte
                 break;
 
             /* Match character classes. */
-            if (classmatch(*pattern, **string, nocase, pattern)
-                == RANGE_MATCH) {
+            switch (classmatch(*pattern, **string, nocase, pattern)) {
+           case RANGE_MATCH:
                 result = 0;
-                continue;
-            }
+               continue;
+           case RANGE_NOMATCH:
+               /* Valid character class but no match. */
+               continue;
+           default:
+               /* Not a valid character class. */
+               break;
+           }
             if (!**pattern)
                 break;
 

Reply via email to