summaryrefslogtreecommitdiffstats
path: root/sys/libkern
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-04-04 18:44:19 +0000
committerache <ache@FreeBSD.org>1997-04-04 18:44:19 +0000
commit9f599254e5f962e4d5f614b2fce1409bb1362462 (patch)
tree83db69c797a6aa8f93e5bd1f5489c7e340ecd0d6 /sys/libkern
parent13cee1ee0505f8dc0434fc0c46b9e5df37072d26 (diff)
downloadFreeBSD-src-9f599254e5f962e4d5f614b2fce1409bb1362462.zip
FreeBSD-src-9f599254e5f962e4d5f614b2fce1409bb1362462.tar.gz
Speedup in case locale not used
Diffstat (limited to 'sys/libkern')
-rw-r--r--sys/libkern/fnmatch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/libkern/fnmatch.c b/sys/libkern/fnmatch.c
index f53963a..bd818cf 100644
--- a/sys/libkern/fnmatch.c
+++ b/sys/libkern/fnmatch.c
@@ -187,8 +187,12 @@ rangematch(pattern, test, flags)
if (flags & FNM_CASEFOLD)
c2 = tolower((unsigned char)c2);
- if ( __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)
OpenPOWER on IntegriCloud