summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/getcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/getcap.c')
-rw-r--r--lib/libc/gen/getcap.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index f883ec4..6bb4450 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -42,7 +42,7 @@ static char sccsid[] = "@(#)getcap.c 8.3 (Berkeley) 3/25/94";
#include <ctype.h>
#include <db.h>
-#include <errno.h>
+#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
@@ -198,7 +198,7 @@ getent(cap, len, db_array, fd, name, depth, nfield)
char *record, *cbuf;
int tc_not_resolved;
char pbuf[_POSIX_PATH_MAX];
-
+
/*
* Return with ``loop detected'' error if we've recursed more than
* MAX_RECURSION times.
@@ -306,7 +306,7 @@ getent(cap, len, db_array, fd, name, depth, nfield)
for (;;) {
if (bp >= b_end) {
int n;
-
+
n = read(fd, buf, sizeof(buf));
if (n <= 0) {
if (myfd)
@@ -323,7 +323,7 @@ getent(cap, len, db_array, fd, name, depth, nfield)
b_end = buf+n;
bp = buf;
}
-
+
c = *bp++;
if (c == '\n') {
if (rp > record && *(rp-1) == '\\') {
@@ -335,7 +335,7 @@ getent(cap, len, db_array, fd, name, depth, nfield)
*rp++ = c;
/*
- * Enforce loop invariant: if no room
+ * Enforce loop invariant: if no room
* left in record buffer, try to get
* some more.
*/
@@ -364,13 +364,13 @@ getent(cap, len, db_array, fd, name, depth, nfield)
*/
if (eof)
break;
-
+
/*
* Toss blank lines and comments.
*/
if (*record == '\0' || *record == '#')
continue;
-
+
/*
* See if this is the record we want ...
*/
@@ -431,7 +431,7 @@ tc_exp: {
tclen = s - tcstart;
tcend = s;
- iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
+ iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
NULL);
newicap = icap; /* Put into a register. */
newilen = ilen;
@@ -447,11 +447,11 @@ tc_exp: {
tc_not_resolved = 1;
/* couldn't resolve tc */
if (iret == -1) {
- *(s - 1) = ':';
+ *(s - 1) = ':';
scan = s - 1;
tc_not_resolved = 1;
continue;
-
+
}
}
/* not interested in name field of tc'ed record */
@@ -514,7 +514,7 @@ tc_exp: {
*/
scan = s-1;
}
-
+
}
/*
* Close file (if we opened it), give back any extra memory, and
@@ -524,17 +524,17 @@ tc_exp: {
(void)close(fd);
*len = rp - record - 1; /* don't count NUL */
if (r_end > rp)
- if ((record =
+ if ((record =
realloc(record, (size_t)(rp - record))) == NULL) {
errno = ENOMEM;
return (-2);
}
-
+
*cap = record;
if (tc_not_resolved)
return (1);
return (0);
-}
+}
static int
cdbget(capdbp, bp, name)
@@ -564,7 +564,7 @@ cdbget(capdbp, bp, name)
key.data = (char *)data.data + 1;
key.size = data.size - 1;
}
-
+
*bp = (char *)data.data + 1;
return (((char *)(data.data))[0] == TCERR ? 1 : 0);
}
@@ -641,7 +641,7 @@ cgetclose()
}
/*
- * Cgetnext() gets either the first or next entry in the logical database
+ * Cgetnext() gets either the first or next entry in the logical database
* specified by db_array. It returns 0 upon completion of the database, 1
* upon returning an entry with more remaining, and -1 if an error occurs.
*/
@@ -702,10 +702,10 @@ cgetnext(bp, db_array)
slash = 1;
else
slash = 0;
- }
+ }
- /*
+ /*
* Line points to a name line.
*/
i = 0;
@@ -745,12 +745,12 @@ cgetnext(bp, db_array)
*rp++ = *cp;
*rp = '\0';
- /*
- * XXX
+ /*
+ * XXX
* Last argument of getent here should be nbuf if we want true
- * sequential access in the case of duplicates.
+ * sequential access in the case of duplicates.
* With NULL, getent will return the first entry found
- * rather than the duplicate entry record. This is a
+ * rather than the duplicate entry record. This is a
* matter of semantics that should be resolved.
*/
status = getent(bp, &dummy, db_array, -1, buf, 0, NULL);
@@ -894,10 +894,10 @@ cgetstr(buf, cap, str)
* Cgetustr retrieves the value of the string capability cap from the
* capability record pointed to by buf. The difference between cgetustr()
* and cgetstr() is that cgetustr does not decode escapes but rather treats
- * all characters literally. A pointer to a NUL terminated malloc'd
- * copy of the string is returned in the char pointed to by str. The
+ * all characters literally. A pointer to a NUL terminated malloc'd
+ * copy of the string is returned in the char pointed to by str. The
* length of the string not including the trailing NUL is returned on success,
- * -1 if the requested string capability couldn't be found, -2 if a system
+ * -1 if the requested string capability couldn't be found, -2 if a system
* error was encountered (storage allocation failure).
*/
int
@@ -1039,10 +1039,10 @@ nfcmp(nf, rec)
{
char *cp, tmp;
int ret;
-
+
for (cp = rec; *cp != ':'; cp++)
;
-
+
tmp = *(cp + 1);
*(cp + 1) = '\0';
ret = strcmp(nf, rec);
OpenPOWER on IntegriCloud