-/* $OpenBSD: getgrent.c,v 1.25 2008/06/24 14:29:45 deraadt Exp $ */
+/* $OpenBSD: getgrent.c,v 1.26 2008/08/25 22:30:19 deraadt Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
}
#ifdef YP
if (line[0] == '+') {
- if (foundyp) {
- *foundyp = 1;
- return (NULL);
- }
switch (line[1]) {
case ':':
case '\0':
case '\n':
+ if (foundyp) {
+ *foundyp = 1;
+ return (NULL);
+ }
if (_yp_check(NULL)) {
if (!search) {
__ypmode = YPMODE_FULL;
char *tptr;
tptr = strsep(&bp, ":\n");
+ tptr++;
if (search && name && strcmp(tptr, name))
continue;
__ypmode = YPMODE_NAME;
- grname = strdup(tptr + 1);
+ grname = strdup(tptr);
continue;
}
break;