MCPcopy Create free account
hub / github.com/GJDuck/e9patch / getenv

Function getenv

examples/stdlib.c:5955–5970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5953static char **environ = NULL;
5954
5955static char *getenv(const char *name)
5956{
5957 if (environ == NULL)
5958 panic("environ not initialized");
5959 for (char **p = environ; *p != NULL; p++)
5960 {
5961 char *def = *p;
5962 size_t i;
5963 for (i = 0; def[i] != '=' && def[i] != '\0' &&
5964 def[i] == name[i]; i++)
5965 ;
5966 if (def[i] == '=' && name[i] == '\0')
5967 return def+i+1;
5968 }
5969 return NULL;
5970}
5971
5972static __attribute__((__noreturn__)) void exit(int status)
5973{

Callers 6

e9frontend.cppFile · 0.85
getPathFunction · 0.85
initFunction · 0.85
initFunction · 0.85
initFunction · 0.85
initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected