ref: 2e7e4ca6b9def1b7bae6b93285f6431039f9656a
dir: /src/libc/arch/posix/getenv.c/
#include <stdlib.h>
#include <string.h>
#undef getenv
extern char **_environ;
char *
getenv(const char *name)
{
char **p, *s;
size_t len = strlen(name);
for (p = _environ; s = *p; ++p) {
if (!strncmp(name, s, len) && s[len] == '=')
return s + len + 1;
}
return NULL;
}