Deleted Added
full compact
getnetgrent.c (33950) getnetgrent.c (52856)
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 18 unchanged lines hidden (view full) ---

27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * $FreeBSD: head/lib/libc/gen/getnetgrent.c 52856 1999-11-04 04:16:28Z ache $
35 */
36
37#if defined(LIBC_SCCS) && !defined(lint)
38static char sccsid[] = "@(#)getnetgrent.c 8.2 (Berkeley) 4/27/95";
39#endif /* LIBC_SCCS and not lint */
40
41#include <stdio.h>
42#include <strings.h>

--- 235 unchanged lines hidden (view full) ---

278static int _listmatch(list, group, len)
279 char *list, *group;
280 int len;
281{
282 char *ptr = list, *cptr;
283 int glen = strlen(group);
284
285 /* skip possible leading whitespace */
37 */
38
39#if defined(LIBC_SCCS) && !defined(lint)
40static char sccsid[] = "@(#)getnetgrent.c 8.2 (Berkeley) 4/27/95";
41#endif /* LIBC_SCCS and not lint */
42
43#include <stdio.h>
44#include <strings.h>

--- 235 unchanged lines hidden (view full) ---

280static int _listmatch(list, group, len)
281 char *list, *group;
282 int len;
283{
284 char *ptr = list, *cptr;
285 int glen = strlen(group);
286
287 /* skip possible leading whitespace */
286 while(isspace(*ptr))
288 while(isspace((unsigned char)*ptr))
287 ptr++;
288
289 while (ptr < list + len) {
290 cptr = ptr;
289 ptr++;
290
291 while (ptr < list + len) {
292 cptr = ptr;
291 while(*ptr != ',' && *ptr != '\0' && !isspace(*ptr))
293 while(*ptr != ',' && *ptr != '\0' && !isspace((unsigned char)*ptr))
292 ptr++;
293 if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr))
294 return(1);
294 ptr++;
295 if (strncmp(cptr, group, glen) == 0 && glen == (ptr - cptr))
296 return(1);
295 while(*ptr == ',' || isspace(*ptr))
297 while(*ptr == ',' || isspace((unsigned char)*ptr))
296 ptr++;
297 }
298
299 return(0);
300}
301
302static int _buildkey(key, str, dom, rotation)
303char *key, *str, *dom;

--- 329 unchanged lines hidden ---
298 ptr++;
299 }
300
301 return(0);
302}
303
304static int _buildkey(key, str, dom, rotation)
305char *key, *str, *dom;

--- 329 unchanged lines hidden ---