ack/lang/cem/libcc/gen/getenv.c
1987-03-31 10:45:53 +00:00

16 lines
270 B
C

/* $Header$ */
char *getenv(name)
register char *name;
{
extern char **environ;
register char **v = environ, *p, *q;
while ((p = *v++) != 0) {
q = name;
while (*q && *q++ == *p++) /* nothing */ ;
if (*q || *p != '=') continue;
return(p+1);
}
return(0);
}