]> git.saurik.com Git - apple/libc.git/blob - gen/FreeBSD/getcap.c.patch
Libc-763.11.tar.gz
[apple/libc.git] / gen / FreeBSD / getcap.c.patch
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
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/gen/getcap.c,v 1.22 2009/05/14 23:09:33 delphij Exp $");
6
7 +#include "xlocale_private.h"
8 +
9 #include "namespace.h"
10 #include <sys/types.h>
11
12 @@ -66,7 +68,7 @@ static char *toprec; /* Additional recor
13 static int gottoprec; /* Flag indicating retrieval of toprecord */
14
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 *);
19
20 /*
21 @@ -162,7 +164,7 @@ cgetent(char **buf, char **db_array, con
22 {
23 u_int dummy;
24
25 - return (getent(buf, &dummy, db_array, -1, name, 0, NULL));
26 + return (getent(buf, &dummy, db_array, -1, name, 0, NULL, __current_locale()));
27 }
28
29 /*
30 @@ -185,7 +187,7 @@ cgetent(char **buf, char **db_array, con
31 */
32 static int
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)
36 {
37 DB *capdbp;
38 char *r_end, *rp, **db_p;
39 @@ -426,7 +428,7 @@ tc_exp: {
40 tcend = s;
41
42 iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
43 - NULL);
44 + NULL, loc);
45 newicap = icap; /* Put into a register. */
46 newilen = ilen;
47 if (iret != 0) {
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];
51 u_int dummy;
52 + locale_t loc = __current_locale();
53
54 if (dbp == NULL)
55 dbp = db_array;
56 @@ -691,7 +694,7 @@ cgetnext(char **bp, char **db_array)
57 slash = 0;
58 continue;
59 }
60 - if (isspace((unsigned char)*line) ||
61 + if (isspace_l((unsigned char)*line, loc) ||
62 *line == ':' || *line == '#' || slash) {
63 if (line[len - 2] == '\\')
64 slash = 1;
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.
68 */
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)
72 (void)cgetclose();
73