source: trunk/sys/dietlibc/getenv.c @ 50

Last change on this file since 50 was 1, checked in by alain, 8 years ago

First import

File size: 305 bytes
Line 
1#include <stdlib.h>
2#include <string.h>
3
4extern char *getenv(const char *s)
5{
6  int i;
7  unsigned int len;
8
9  if (!environ || !s) return 0;
10  len = strlen(s);
11  for (i = 0;environ[i];++i)
12    if ((memcmp(environ[i],s,len)==0) && (environ[i][len] == '='))
13      return environ[i] + len + 1;
14  return 0;
15}
16
Note: See TracBrowser for help on using the repository browser.