source:
trunk/sys/dietlibc/getenv.c
@
266
Last change on this file since 266 was 1, checked in by , 8 years ago | |
---|---|
File size: 305 bytes |
Rev | Line | |
---|---|---|
[1] | 1 | #include <stdlib.h> |
2 | #include <string.h> | |
3 | ||
4 | extern 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.