|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 633 (0x279)
Types: TextFile
Notes: UNIX file
Names: »getenv.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »libc/gen/getenv.c«
/*
* search environment for name
* An environmental parameter is a string of the form "name=value".
* A pointer to the value is returned if the supplied argument matches the
* name, otherwise 0. The value is not a copy, so alterations will be
* reflected in the environment. Bogus parameters are ignored.
*/
char *
getenv( name)
char *name;
{
register char *p,
*q,
**ep;
extern char **environ;
ep = environ;
if (ep == ((char **)0))
return (((char *)0));
while (p = *ep++) {
for (q=name; *q==*p++; ++q)
if (*q == '\0')
break;
if (*q=='\0' && p[-1]=='=')
return (p);
}
return (((char *)0));
}