@@ -71,8 +71,9 @@ enum fnm_char_class {
7171
7272static bool fnm_cc_is_valid (const char * pattern , size_t psize , enum fnm_char_class * cc )
7373{
74- if (psize < 4 || * pattern != ':' )
74+ if (psize < 4 || * pattern != ':' ) {
7575 return false;
76+ }
7677
7778 pattern ++ ; /* skip ':' */
7879 psize -- ;
@@ -178,7 +179,6 @@ static inline int fnm_cc_match(int c, enum fnm_char_class cc)
178179 return 0 ;
179180}
180181
181-
182182static inline int foldcase (int ch , int flags )
183183{
184184
@@ -198,13 +198,15 @@ static bool match_posix_class(const char **pattern, int test)
198198 const char * p = * pattern ;
199199 size_t remaining = strlen (p );
200200
201- if (!fnm_cc_is_valid (p , remaining , & cc ))
201+ if (!fnm_cc_is_valid (p , remaining , & cc )) {
202202 return false;
203+ }
203204
204205 /* move pattern pointer past ":]" */
205206 const char * end = strstr (p , ":]" );
206- if (end )
207+ if (end ) {
207208 * pattern = end + 2 ;
209+ }
208210
209211 return fnm_cc_match (test , cc );
210212}
@@ -253,9 +255,14 @@ static const char *rangematch(const char *pattern, int test, int flags)
253255 ok = true;
254256 continue ;
255257 } else {
256- // skip over class if unrecognized
257- while (* pattern && !(* pattern == ':' && * (pattern + 1 ) == ']' )) pattern ++ ;
258- if (* pattern ) pattern += 2 ;
258+ /* skip over class if unrecognized */
259+ while (* pattern && !(* pattern == ':' && * (pattern + 1 ) == ']' )) {
260+ pattern ++ ;
261+ }
262+
263+ if (* pattern ) {
264+ pattern += 2 ;
265+ }
259266 continue ;
260267 }
261268 }
0 commit comments