1 --- getcap.c.orig 2003-05-20 15:21:01.000000000 -0700
2 +++ getcap.c 2005-02-27 15:52:46.000000000 -0800
5 __FBSDID("$FreeBSD: src/lib/libc/gen/getcap.c,v 1.19 2003/01/02 10:19:43 thomas Exp $");
7 +#include "xlocale_private.h"
10 #include <sys/types.h>
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 *);
25 - return (getent(buf, &dummy, db_array, -1, name, 0, NULL));
26 + return (getent(buf, &dummy, db_array, -1, name, 0, NULL, __current_locale()));
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;
42 iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
45 newicap = icap; /* Put into a register. */
49 int done, hadreaderr, i, savederrno, status;
50 char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE];
52 + locale_t loc = __current_locale();
60 - if (isspace((unsigned char)*line) ||
61 + if (isspace_l((unsigned char)*line, loc) ||
62 *line == ':' || *line == '#' || slash) {
63 if (line[len - 2] == '\\')
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)