]> git.saurik.com Git - apple/libc.git/blame - gen/FreeBSD/getcap.c.patch
Libc-391.2.3.tar.gz
[apple/libc.git] / gen / FreeBSD / getcap.c.patch
CommitLineData
3d9156a7
A
1--- getcap.c.orig 2003-05-20 15:21:01.000000000 -0700
2+++ getcap.c 2005-02-27 15:52:46.000000000 -0800
3@@ -40,6 +40,8 @@
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD: src/lib/libc/gen/getcap.c,v 1.19 2003/01/02 10:19:43 thomas Exp $");
6
7+#include "xlocale_private.h"
8+
9 #include "namespace.h"
10 #include <sys/types.h>
11
12@@ -70,7 +72,7 @@
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@@ -166,7 +168,7 @@
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@@ -189,7 +191,7 @@
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@@ -428,7 +430,7 @@
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@@ -652,6 +654,7 @@
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@@ -693,7 +696,7 @@
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@@ -765,7 +768,7 @@
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