+--- regexec.c.bsdnew 2009-11-11 11:29:04.000000000 -0800
++++ regexec.c 2009-11-11 12:21:46.000000000 -0800
+@@ -39,6 +39,8 @@ static char sccsid[] = "@(#)regexec.c 8.
+ #include <sys/cdefs.h>
+ __FBSDID("$FreeBSD: src/lib/libc/regex/regexec.c,v 1.8 2007/06/11 03:05:54 delphij Exp $");
+
++#include "xlocale_private.h"
++
+ /*
+ * the outer shell of regexec()
+ *
+@@ -62,12 +64,12 @@ __FBSDID("$FreeBSD: src/lib/libc/regex/r
+ static int nope __unused = 0; /* for use in asserts; shuts lint up */
+
+ static __inline size_t
+-xmbrtowc(wint_t *wi, const char *s, size_t n, mbstate_t *mbs, wint_t dummy)
++xmbrtowc(wint_t *wi, const char *s, size_t n, mbstate_t *mbs, wint_t dummy, locale_t loc)
+ {
+ size_t nr;
+ wchar_t wc;
+
+- nr = mbrtowc(&wc, s, n, mbs);
++ nr = mbrtowc_l(&wc, s, n, mbs, loc);
+ if (wi != NULL)
+ *wi = wc;
+ if (nr == 0)
+@@ -86,7 +88,8 @@ xmbrtowc_dummy(wint_t *wi,
+ const char *s,
+ size_t n __unused,
+ mbstate_t *mbs __unused,
+- wint_t dummy __unused)
++ wint_t dummy __unused,
++ locale_t loc __unused)
+ {
+
+ if (wi != NULL)
+@@ -176,6 +179,8 @@ xmbrtowc_dummy(wint_t *wi,