1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1987-01-27 15:57:55 +00:00
|
|
|
char *getenv(name)
|
|
|
|
register char *name;
|
|
|
|
{
|
|
|
|
extern char **environ;
|
|
|
|
register char **v = environ, *p, *q;
|
|
|
|
|
1988-08-30 12:52:09 +00:00
|
|
|
if (v == 0 || name == 0) return 0;
|
1987-01-27 15:57:55 +00:00
|
|
|
while ((p = *v++) != 0) {
|
|
|
|
q = name;
|
|
|
|
while (*q && *q++ == *p++) /* nothing */ ;
|
|
|
|
if (*q || *p != '=') continue;
|
1987-02-05 16:22:42 +00:00
|
|
|
return(p+1);
|
1987-01-27 15:57:55 +00:00
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|