View | Details | Raw Unified | Return to bug 179721 | Differences between
and this patch

Collapse All | Expand All

(-)lib/libc/gen/fnmatch.c (-2 / +2 lines)
Lines 296-303 Link Here
296
296
297
			if (table->__collate_load_error ?
297
			if (table->__collate_load_error ?
298
			    c <= test && test <= c2 :
298
			    c <= test && test <= c2 :
299
			       __collate_range_cmp(table, c, test) <= 0
299
			       __wcollate_range_cmp(table, c, test) <= 0
300
			    && __collate_range_cmp(table, test, c2) <= 0
300
			    && __wcollate_range_cmp(table, test, c2) <= 0
301
			   )
301
			   )
302
				ok = 1;
302
				ok = 1;
303
		} else if (c == test)
303
		} else if (c == test)
(-)lib/libc/gen/glob.c (-2 / +2 lines)
Lines 832-839 Link Here
832
				if ((*pat & M_MASK) == M_RNG) {
832
				if ((*pat & M_MASK) == M_RNG) {
833
					if (table->__collate_load_error ?
833
					if (table->__collate_load_error ?
834
					    CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) :
834
					    CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) :
835
					       __collate_range_cmp(table, CHAR(c), CHAR(k)) <= 0
835
					       __wcollate_range_cmp(table, CHAR(c), CHAR(k)) <= 0
836
					    && __collate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0
836
					    && __wcollate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0
837
					   )
837
					   )
838
						ok = 1;
838
						ok = 1;
839
					pat += 2;
839
					pat += 2;
(-)lib/libc/locale/collate.h (-1 / +2 lines)
Lines 128-134 Link Here
128
int	__collate_equiv_value(locale_t, const wchar_t *, size_t);
128
int	__collate_equiv_value(locale_t, const wchar_t *, size_t);
129
void	_collate_lookup(struct xlocale_collate *,const wchar_t *, int *, int *,
129
void	_collate_lookup(struct xlocale_collate *,const wchar_t *, int *, int *,
130
	int, const int **);
130
	int, const int **);
131
int	__collate_range_cmp(struct xlocale_collate *, wchar_t, wchar_t);
131
int	__collate_range_cmp(struct xlocale_collate *, char, char);
132
int	__wcollate_range_cmp(struct xlocale_collate *, wchar_t, wchar_t);
132
size_t	_collate_wxfrm(struct xlocale_collate *, const wchar_t *, wchar_t *,
133
size_t	_collate_wxfrm(struct xlocale_collate *, const wchar_t *, wchar_t *,
133
	size_t);
134
	size_t);
134
size_t	_collate_sxfrm(struct xlocale_collate *, const wchar_t *, char *,
135
size_t	_collate_sxfrm(struct xlocale_collate *, const wchar_t *, char *,
(-)lib/libc/locale/collcmp.c (-3 / +16 lines)
Lines 41-54 Link Here
41
 * Compare two characters using collate
41
 * Compare two characters using collate
42
 */
42
 */
43
43
44
int __collate_range_cmp(struct xlocale_collate *table, wchar_t c1, wchar_t c2)
44
int __collate_range_cmp(struct xlocale_collate *table, char c1, char c2)
45
{
45
{
46
	char s1[2], s2[2];
47
48
	s1[0] = c1;
49
	s1[1] = '\0';
50
	s2[0] = c2;
51
	s2[1] = '\0';
52
	struct _xlocale l = {{0}};
53
	l.components[XLC_COLLATE] = (struct xlocale_component *)table;
54
	return (strcoll_l(s1, s2, &l));
55
}
56
57
int __wcollate_range_cmp(struct xlocale_collate *table, wchar_t c1, wchar_t c2)
58
{
46
	wchar_t s1[2], s2[2];
59
	wchar_t s1[2], s2[2];
47
60
48
	s1[0] = c1;
61
	s1[0] = c1;
49
	s1[1] = 0;
62
	s1[1] = L'\0';
50
	s2[0] = c2;
63
	s2[0] = c2;
51
	s2[1] = 0;
64
	s2[1] = L'\0';
52
	struct _xlocale l = {{0}};
65
	struct _xlocale l = {{0}};
53
	l.components[XLC_COLLATE] = (struct xlocale_component *)table;
66
	l.components[XLC_COLLATE] = (struct xlocale_component *)table;
54
	return (wcscoll_l(s1, s2, &l));
67
	return (wcscoll_l(s1, s2, &l));
(-)lib/libc/regex/regcomp.c (-3 / +3 lines)
Lines 821-830 Link Here
821
				(void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE);
821
				(void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE);
822
				CHaddrange(p, cs, start, finish);
822
				CHaddrange(p, cs, start, finish);
823
			} else {
823
			} else {
824
				(void)REQUIRE(__collate_range_cmp(table, start, finish) <= 0, REG_ERANGE);
824
				(void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE);
825
				for (i = 0; i <= UCHAR_MAX; i++) {
825
				for (i = 0; i <= UCHAR_MAX; i++) {
826
					if (   __collate_range_cmp(table, start, i) <= 0
826
					if (   __wcollate_range_cmp(table, start, i) <= 0
827
					    && __collate_range_cmp(table, i, finish) <= 0
827
					    && __wcollate_range_cmp(table, i, finish) <= 0
828
					   )
828
					   )
829
						CHadd(p, cs, i);
829
						CHadd(p, cs, i);
830
				}
830
				}

Return to bug 179721