1 --- vis.c.orig 2004-11-25 11:38:02.000000000 -0800
2 +++ vis.c 2005-02-24 16:58:00.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/gen/vis.c,v 1.13 2003/10/30 12:41:50 phk Exp $");
7 +#include "xlocale_private.h"
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);
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') ||
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';
58 + if (iscntrl_l(c, loc)) {