15 lines
253 B
C
15 lines
253 B
C
|
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);
|
||
|
}
|
||
|
return(0);
|
||
|
}
|