1 --- unvis.c.orig 2009-11-07 14:51:38.000000000 -0800
2 +++ unvis.c 2009-11-07 14:51:40.000000000 -0800
3 @@ -33,6 +33,8 @@ static char sccsid[] = "@(#)unvis.c 8.1
5 __FBSDID("$FreeBSD: src/lib/libc/gen/unvis.c,v 1.10 2007/01/09 00:27:56 imp Exp $");
7 +#include "xlocale_private.h"
12 @@ -60,6 +62,7 @@ __FBSDID("$FreeBSD: src/lib/libc/gen/unv
14 unvis(char *cp, int c, int *astate, int flag)
16 + locale_t loc = __current_locale();
18 if (flag & UNVIS_END) {
19 if (*astate == S_OCTAL2 || *astate == S_OCTAL3) {
20 @@ -86,8 +89,8 @@ unvis(char *cp, int c, int *astate, int
23 if (*astate & S_HTTP) {
24 - if (ishex(tolower(c))) {
25 - *cp = isdigit(c) ? (c - '0') : (tolower(c) - 'a');
26 + if (ishex(tolower_l(c, loc))) {
27 + *cp = isdigit_l(c, loc) ? (c - '0') : (tolower_l(c, loc) - 'a');
31 @@ -212,8 +215,8 @@ unvis(char *cp, int c, int *astate, int
32 return (UNVIS_VALIDPUSH);
34 case S_HEX2: /* second mandatory hex digit */
35 - if (ishex(tolower(c))) {
36 - *cp = (isdigit(c) ? (*cp << 4) + (c - '0') : (*cp << 4) + (tolower(c) - 'a' + 10));
37 + if (ishex(tolower_l(c, loc))) {
38 + *cp = (isdigit_l(c, loc) ? (*cp << 4) + (c - '0') : (*cp << 4) + (tolower_l(c, loc) - 'a' + 10));