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 285-292 rangematch(pattern, test, flags, newp, p Link Here
285
285
286
			if (table->__collate_load_error ?
286
			if (table->__collate_load_error ?
287
			    c <= test && test <= c2 :
287
			    c <= test && test <= c2 :
288
			       __collate_range_cmp(table, c, test) <= 0
288
			       __wcollate_range_cmp(table, c, test) <= 0
289
			    && __collate_range_cmp(table, test, c2) <= 0
289
			    && __wcollate_range_cmp(table, test, c2) <= 0
290
			   )
290
			   )
291
				ok = 1;
291
				ok = 1;
292
		} else if (c == test)
292
		} else if (c == test)
(-)lib/libc/gen/glob.c (-2 / +2 lines)
Lines 836-843 match(Char *name, Char *pat, Char *paten Link Here
836
				if ((*pat & M_MASK) == M_RNG) {
836
				if ((*pat & M_MASK) == M_RNG) {
837
					if (table->__collate_load_error ?
837
					if (table->__collate_load_error ?
838
					    CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) :
838
					    CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) :
839
					       __collate_range_cmp(table, CHAR(c), CHAR(k)) <= 0
839
					       __wcollate_range_cmp(table, CHAR(c), CHAR(k)) <= 0
840
					    && __collate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0
840
					    && __wcollate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0
841
					   )
841
					   )
842
						ok = 1;
842
						ok = 1;
843
					pat += 2;
843
					pat += 2;
(-)lib/libc/locale/collate.h (+1 lines)
Lines 73-78 u_char *__collate_substitute(struct xloc Link Here
73
int	__collate_load_tables(const char *);
73
int	__collate_load_tables(const char *);
74
void	__collate_lookup(struct xlocale_collate *, const u_char *, int *, int *, int *);
74
void	__collate_lookup(struct xlocale_collate *, const u_char *, int *, int *, int *);
75
int	__collate_range_cmp(struct xlocale_collate *, int, int);
75
int	__collate_range_cmp(struct xlocale_collate *, int, int);
76
int	__wcollate_range_cmp(struct xlocale_collate *, int, int);
76
#ifdef COLLATE_DEBUG
77
#ifdef COLLATE_DEBUG
77
void	__collate_print_tables(void);
78
void	__collate_print_tables(void);
78
#endif
79
#endif
(-)lib/libc/locale/collcmp.c (+10 lines)
Lines 50-52 int __collate_range_cmp(struct xlocale_c Link Here
50
	l.components[XLC_COLLATE] = (struct xlocale_component *)table;
50
	l.components[XLC_COLLATE] = (struct xlocale_component *)table;
51
	return (strcoll_l(s1, s2, &l));
51
	return (strcoll_l(s1, s2, &l));
52
}
52
}
53
int __wcollate_range_cmp(struct xlocale_collate *table, int c1, int c2)
54
{
55
	static wchar_t s1[2], s2[2];
56
57
	s1[0] = c1;
58
	s2[0] = c2;
59
	struct _xlocale l = {{0}};
60
	l.components[XLC_COLLATE] = (struct xlocale_component *)table;
61
	return (wcscoll_l(s1, s2, &l));
62
}
(-)lib/libc/regex/regcomp.c (-3 / +3 lines)
Lines 789-798 p_b_term(struct parse *p, cset *cs) Link Here
789
				(void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE);
789
				(void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE);
790
				CHaddrange(p, cs, start, finish);
790
				CHaddrange(p, cs, start, finish);
791
			} else {
791
			} else {
792
				(void)REQUIRE(__collate_range_cmp(table, start, finish) <= 0, REG_ERANGE);
792
				(void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE);
793
				for (i = 0; i <= UCHAR_MAX; i++) {
793
				for (i = 0; i <= UCHAR_MAX; i++) {
794
					if (   __collate_range_cmp(table, start, i) <= 0
794
					if (   __wcollate_range_cmp(table, start, i) <= 0
795
					    && __collate_range_cmp(table, i, finish) <= 0
795
					    && __wcollate_range_cmp(table, i, finish) <= 0
796
					   )
796
					   )
797
						CHadd(p, cs, i);
797
						CHadd(p, cs, i);
798
				}
798
				}

Return to bug 179721