diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index bd818cf7b4b..1330ddbf4fe 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -187,12 +187,10 @@ rangematch(pattern, test, flags) if (flags & FNM_CASEFOLD) c2 = tolower((unsigned char)c2); - if ( ( __collate_load_error - && c <= test && test <= c2 - ) - || ( __collate_range_cmp(c, test) <= 0 - && __collate_range_cmp(test, c2) <= 0 - ) + if (__collate_load_error ? + c <= test && test <= c2 : + __collate_range_cmp(c, test) <= 0 + && __collate_range_cmp(test, c2) <= 0 ) ok = 1; } else if (c == test) diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c index bd818cf7b4b..1330ddbf4fe 100644 --- a/sys/libkern/fnmatch.c +++ b/sys/libkern/fnmatch.c @@ -187,12 +187,10 @@ rangematch(pattern, test, flags) if (flags & FNM_CASEFOLD) c2 = tolower((unsigned char)c2); - if ( ( __collate_load_error - && c <= test && test <= c2 - ) - || ( __collate_range_cmp(c, test) <= 0 - && __collate_range_cmp(test, c2) <= 0 - ) + if (__collate_load_error ? + c <= test && test <= c2 : + __collate_range_cmp(c, test) <= 0 + && __collate_range_cmp(test, c2) <= 0 ) ok = 1; } else if (c == test)