Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / argz / argz_next.c
blob0d6f21d70593bb2591c3f9fb234e3486e10fc88f
1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
7 #include <argz.h>
8 #include <errno.h>
9 #include <sys/types.h>
10 #include <string.h>
11 #include <stdlib.h>
13 char *
14 argz_next (char *argz,
15 size_t argz_len,
16 const char *entry)
18 if (entry)
20 while(*entry != '\0')
21 entry++;
22 entry++;
24 if (entry >= argz + argz_len)
25 return NULL;
26 else
27 return (char *) entry;
29 else
31 if (argz_len > 0)
32 return (char *) argz;
33 else
34 return NULL;