]>
Commit | Line | Data |
---|---|---|
1f2f436a A |
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 | |
3d9156a7 | 4 | #include <sys/cdefs.h> |
1f2f436a | 5 | __FBSDID("$FreeBSD: src/lib/libc/gen/getcap.c,v 1.22 2009/05/14 23:09:33 delphij Exp $"); |
3d9156a7 A |
6 | |
7 | +#include "xlocale_private.h" | |
8 | + | |
9 | #include "namespace.h" | |
10 | #include <sys/types.h> | |
11 | ||
1f2f436a | 12 | @@ -66,7 +68,7 @@ static char *toprec; /* Additional recor |
3d9156a7 A |
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 | /* | |
1f2f436a | 21 | @@ -162,7 +164,7 @@ cgetent(char **buf, char **db_array, con |
3d9156a7 A |
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 | /* | |
1f2f436a | 30 | @@ -185,7 +187,7 @@ cgetent(char **buf, char **db_array, con |
3d9156a7 A |
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; | |
1f2f436a | 39 | @@ -426,7 +428,7 @@ tc_exp: { |
3d9156a7 A |
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) { | |
1f2f436a | 48 | @@ -650,6 +652,7 @@ cgetnext(char **bp, char **db_array) |
3d9156a7 A |
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; | |
1f2f436a | 56 | @@ -691,7 +694,7 @@ cgetnext(char **bp, char **db_array) |
3d9156a7 A |
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; | |
1f2f436a | 65 | @@ -763,7 +766,7 @@ cgetnext(char **bp, char **db_array) |
3d9156a7 A |
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 |