View | Details | Raw Unified | Return to bug 207681
Collapse All | Expand All

(-)lib/libc/regex/regex.3 (-2 lines)
Lines 723-727 Link Here
723
.Pp
723
.Pp
724
The implementation of word-boundary matching is a bit of a kludge,
724
The implementation of word-boundary matching is a bit of a kludge,
725
and bugs may lurk in combinations of word-boundary matching and anchoring.
725
and bugs may lurk in combinations of word-boundary matching and anchoring.
726
.Pp
727
Word-boundary matching does not work properly in multibyte locales.
(-)lib/libc/regex/regexec.c (-6 / +6 lines)
Lines 116-124 Link Here
116
#define	FWD(dst, src, n)	((dst) |= ((unsigned long)(src)&(here)) << (n))
116
#define	FWD(dst, src, n)	((dst) |= ((unsigned long)(src)&(here)) << (n))
117
#define	BACK(dst, src, n)	((dst) |= ((unsigned long)(src)&(here)) >> (n))
117
#define	BACK(dst, src, n)	((dst) |= ((unsigned long)(src)&(here)) >> (n))
118
#define	ISSETBACK(v, n)	(((v) & ((unsigned long)here >> (n))) != 0)
118
#define	ISSETBACK(v, n)	(((v) & ((unsigned long)here >> (n))) != 0)
119
/* no multibyte support */
119
/* multibyte support */
120
#define	XMBRTOWC	xmbrtowc_dummy
120
#define	XMBRTOWC	xmbrtowc
121
#define	ZAPSTATE(mbs)	((void)(mbs))
121
#define	ZAPSTATE(mbs)	memset((mbs), 0, sizeof(*(mbs)))
122
/* function names */
122
/* function names */
123
#define SNAMES			/* engine.c looks after details */
123
#define SNAMES			/* engine.c looks after details */
124
124
Lines 170-178 Link Here
170
#define	FWD(dst, src, n)	((dst)[here+(n)] |= (src)[here])
170
#define	FWD(dst, src, n)	((dst)[here+(n)] |= (src)[here])
171
#define	BACK(dst, src, n)	((dst)[here-(n)] |= (src)[here])
171
#define	BACK(dst, src, n)	((dst)[here-(n)] |= (src)[here])
172
#define	ISSETBACK(v, n)	((v)[here - (n)])
172
#define	ISSETBACK(v, n)	((v)[here - (n)])
173
/* no multibyte support */
173
/* multibyte support */
174
#define	XMBRTOWC	xmbrtowc_dummy
174
#define	XMBRTOWC	xmbrtowc
175
#define	ZAPSTATE(mbs)	((void)(mbs))
175
#define	ZAPSTATE(mbs)	memset((mbs), 0, sizeof(*(mbs)))
176
/* function names */
176
/* function names */
177
#define	LNAMES			/* flag */
177
#define	LNAMES			/* flag */
178
178

Return to bug 207681