1 --- vis.c.orig 2009-11-07 14:51:38.000000000 -0800
2 +++ vis.c 2009-11-07 14:51:40.000000000 -0800
3 @@ -33,6 +33,8 @@ static char sccsid[] = "@(#)vis.c 8.1 (B
5 __FBSDID("$FreeBSD: src/lib/libc/gen/vis.c,v 1.14 2007/01/09 00:27:56 imp Exp $");
7 +#include "xlocale_private.h"
12 @@ -50,18 +52,20 @@ vis(dst, c, flag, nextc)
16 + locale_t loc = __current_locale();
20 if (flag & VIS_HTTPSTYLE) {
21 /* Described in RFC 1808 */
22 - if (!(isalnum(c) /* alpha-numeric */
23 + if (!(isalnum_l(c, loc) /* alpha-numeric */
25 || c == '$' || c == '-' || c == '_' || c == '.' || c == '+'
27 || c == '!' || c == '*' || c == '\'' || c == '('
28 || c == ')' || c == ',')) {
30 - snprintf(dst, 4, (c < 16 ? "0%X" : "%X"), c);
31 + snprintf_l(dst, 4, loc, (c < 16 ? "0%X" : "%X"), c);
35 @@ -70,7 +74,7 @@ vis(dst, c, flag, nextc)
36 if ((flag & VIS_GLOB) &&
37 (c == '*' || c == '?' || c == '[' || c == '#'))
39 - else if (isgraph(c) ||
40 + else if (isgraph_l(c, loc) ||
41 ((flag & VIS_SP) == 0 && c == ' ') ||
42 ((flag & VIS_TAB) == 0 && c == '\t') ||
43 ((flag & VIS_NL) == 0 && c == '\n') ||
44 @@ -126,7 +130,7 @@ vis(dst, c, flag, nextc)
48 - if (((c & 0177) == ' ') || isgraph(c) || (flag & VIS_OCTAL)) {
49 + if (((c & 0177) == ' ') || isgraph_l(c, loc) || (flag & VIS_OCTAL)) {
51 *dst++ = ((u_char)c >> 6 & 07) + '0';
52 *dst++ = ((u_char)c >> 3 & 07) + '0';
53 @@ -139,7 +143,7 @@ vis(dst, c, flag, nextc)
58 + if (iscntrl_l(c, loc)) {