1 --- unvis.c.orig 2004-11-25 11:38:02.000000000 -0800
2 +++ unvis.c 2005-02-27 01:14:02.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/gen/unvis.c,v 1.9 2004/08/02 08:46:23 stefanf Exp $");
7 +#include "xlocale_private.h"
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) {
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');
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));