summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/getgrent.c
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1997-03-08 16:21:40 +0000
committerwosch <wosch@FreeBSD.org>1997-03-08 16:21:40 +0000
commit4a0049173679170d5c226fa7f6601530470931eb (patch)
treed30e67ffbea2f6d3cd8e79521a971496b2dd8d32 /lib/libc/gen/getgrent.c
parent392282ab2e2a78822abe76e13d5e87acb6294a73 (diff)
downloadFreeBSD-src-4a0049173679170d5c226fa7f6601530470931eb.zip
FreeBSD-src-4a0049173679170d5c226fa7f6601530470931eb.tar.gz
Allow comments in group database.
The character `#' introduces a comment. Leading spaces and tabs are ignored: '^[ \t]*#.*\n$' Count an empty line - only spaces, tabs or newline - also as a comment. (to be compatibel with password database comments). '^[ \t]*\n$'
Diffstat (limited to 'lib/libc/gen/getgrent.c')
-rw-r--r--lib/libc/gen/getgrent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 47d229e..26069c6 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -70,7 +70,7 @@ static int maxlinelength; /* current length of *line */
* 256K is enough for 64,000 uids
*/
#define MAXLINELENGTHLIMIT (256 * 1024)
-
+#define GROUP_IGNORE_COMMENTS 1 /* allow comments in /etc/group */
struct group *
getgrent()
@@ -287,7 +287,7 @@ grscan(search, gid, name)
for (cp = line; *cp != '\0'; cp++)
if (*cp != ' ' && *cp != '\t')
break;
- if (*cp == '#')
+ if (*cp == '#' || *cp == '\0')
continue;
#endif
OpenPOWER on IntegriCloud