1 --- inet_net_pton.c.orig 2004-11-25 11:38:29.000000000 -0800
2 +++ inet_net_pton.c 2005-02-24 16:53:40.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/net/inet_net_pton.c,v 1.9 2003/09/15 23:38:06 fenner Exp $");
7 +#include "xlocale_private.h"
10 #include <sys/socket.h>
11 #include <netinet/in.h>
13 digits[] = "0123456789";
14 int n, ch, tmp, dirty, bits;
15 const u_char *odst = dst;
16 + locale_t loc = __current_locale();
19 if (ch == '0' && (src[0] == 'x' || src[0] == 'X')
20 - && isascii(src[1]) && isxdigit(src[1])) {
21 + && isascii(src[1]) && isxdigit_l(src[1], loc)) {
22 /* Hexadecimal: Eat nybble string. */
26 src++; /* skip x or X. */
27 while ((ch = *src++) != '\0' &&
28 - isascii(ch) && isxdigit(ch)) {
31 + isascii(ch) && isxdigit_l(ch, loc)) {
32 + if (isupper_l(ch, loc))
33 + ch = tolower_l(ch, loc);
34 n = strchr(xdigits, ch) - xdigits;
35 assert(n >= 0 && n <= 15);
41 - } else if (isascii(ch) && isdigit(ch)) {
42 + } else if (isascii(ch) && isdigit_l(ch, loc)) {
43 /* Decimal: eat dotted digit string. */
49 } while ((ch = *src++) != '\0' &&
50 - isascii(ch) && isdigit(ch));
51 + isascii(ch) && isdigit_l(ch, loc));
54 *dst++ = (u_char) tmp;
59 - if (!isascii(ch) || !isdigit(ch))
60 + if (!isascii(ch) || !isdigit_l(ch, loc))
67 - if (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {
68 + if (ch == '/' && isascii(src[0]) && isdigit_l(src[0], loc) && dst > odst) {
69 /* CIDR width specifier. Nothing can follow it. */
70 ch = *src++; /* Skip over the /. */
73 assert(n >= 0 && n <= 9);
76 - } while ((ch = *src++) != '\0' && isascii(ch) && isdigit(ch));
77 + } while ((ch = *src++) != '\0' && isascii(ch) && isdigit_l(ch, loc));