1 --- getcap.c.orig 2009-11-07 14:51:38.000000000 -0800
2 +++ getcap.c 2009-11-07 14:51:40.000000000 -0800
3 @@ -36,6 +36,8 @@ static char sccsid[] = "@(#)getcap.c 8.3
5 __FBSDID("$FreeBSD: src/lib/libc/gen/getcap.c,v 1.22 2009/05/14 23:09:33 delphij Exp $");
7 +#include "xlocale_private.h"
10 #include <sys/types.h>
12 @@ -66,7 +68,7 @@ static char *toprec; /* Additional recor
13 static int gottoprec; /* Flag indicating retrieval of toprecord */
15 static int cdbget(DB *, char **, const char *);
16 -static int getent(char **, u_int *, char **, int, const char *, int, char *);
17 +static int getent(char **, u_int *, char **, int, const char *, int, char *, locale_t);
18 static int nfcmp(char *, char *);
21 @@ -162,7 +164,7 @@ cgetent(char **buf, char **db_array, con
25 - return (getent(buf, &dummy, db_array, -1, name, 0, NULL));
26 + return (getent(buf, &dummy, db_array, -1, name, 0, NULL, __current_locale()));
30 @@ -185,7 +187,7 @@ cgetent(char **buf, char **db_array, con
33 getent(char **cap, u_int *len, char **db_array, int fd, const char *name,
34 - int depth, char *nfield)
35 + int depth, char *nfield, locale_t loc)
38 char *r_end, *rp, **db_p;
39 @@ -426,7 +428,7 @@ tc_exp: {
42 iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
45 newicap = icap; /* Put into a register. */
48 @@ -650,6 +652,7 @@ cgetnext(char **bp, char **db_array)
49 int done, hadreaderr, i, savederrno, status;
50 char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE];
52 + locale_t loc = __current_locale();
56 @@ -691,7 +694,7 @@ cgetnext(char **bp, char **db_array)
60 - if (isspace((unsigned char)*line) ||
61 + if (isspace_l((unsigned char)*line, loc) ||
62 *line == ':' || *line == '#' || slash) {
63 if (line[len - 2] == '\\')
65 @@ -763,7 +766,7 @@ cgetnext(char **bp, char **db_array)
66 * rather than the duplicate entry record. This is a
67 * matter of semantics that should be resolved.
69 - status = getent(bp, &dummy, db_array, -1, buf, 0, NULL);
70 + status = getent(bp, &dummy, db_array, -1, buf, 0, NULL, loc);
71 if (status == -2 || status == -3)