summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-06-05 19:12:52 +0000
committerpfg <pfg@FreeBSD.org>2016-06-05 19:12:52 +0000
commit0366f1b52787fc04c4e16927e2a5d2d9b9920673 (patch)
tree10d3a6e472257f64e9b5efe360f166cb3ee1940c /lib/libc/regex
parent4d8712daf1610ccab464077fdc055a48a4b845ed (diff)
downloadFreeBSD-src-0366f1b52787fc04c4e16927e2a5d2d9b9920673.zip
FreeBSD-src-0366f1b52787fc04c4e16927e2a5d2d9b9920673.tar.gz
libc/locale: Fix type breakage in __collate_range_cmp().
When collation support was brought in, the second and third arguments in __collate_range_cmp() were changed from int to wchar_t, breaking the ABI. Change them to a "char" type which makes more sense and keeps the ABI compatible. Also introduce __wcollate_range_cmp() which does work with wide characters. This function is used only internally in libc so we don't export it. Use the new function in glob(3), fnmatch(3), and regexec(3). PR: 179721 Suggested by: ache. jilles MFC after: 3 weeks (perhaps partial only)
Diffstat (limited to 'lib/libc/regex')
-rw-r--r--lib/libc/regex/regcomp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index aa9ca9e..5333233 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -821,10 +821,10 @@ p_b_term(struct parse *p, cset *cs)
(void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE);
CHaddrange(p, cs, start, finish);
} else {
- (void)REQUIRE(__collate_range_cmp(table, start, finish) <= 0, REG_ERANGE);
+ (void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE);
for (i = 0; i <= UCHAR_MAX; i++) {
- if ( __collate_range_cmp(table, start, i) <= 0
- && __collate_range_cmp(table, i, finish) <= 0
+ if ( __wcollate_range_cmp(table, start, i) <= 0
+ && __wcollate_range_cmp(table, i, finish) <= 0
)
CHadd(p, cs, i);
}
OpenPOWER on IntegriCloud