blob: 84fc94c00e2f4d9cd11afca25943441a180af99d [file] [log] [blame]
/*
* getenv.c
*/
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char *getenv(const char *name)
{
char **p, *q;
int len = strlen(name);
for ( p = environ ; (q = *p) ; p++ ) {
if ( !strncmp(name, q, len) && q[len] == '=' ) {
return q+(len+1);
}
}
return NULL;
}