source:
azure_iot_hub/trunk/musl-1.1.18/src/env/getenv.c
Last change on this file was 389, checked in by , 5 years ago | |
---|---|
|
|
File size: 325 bytes |
Rev | Line | |
---|---|---|
[388] | 1 | #include <stdlib.h> |
2 | #include <string.h> | |
3 | #include "libc.h" | |
4 | ||
5 | char *__strchrnul(const char *, int); | |
6 | ||
7 | char *getenv(const char *name) | |
8 | { | |
9 | size_t l = __strchrnul(name, '=') - name; | |
10 | if (l && !name[l] && __environ) | |
11 | for (char **e = __environ; *e; e++) | |
12 | if (!strncmp(name, *e, l) && l[*e] == '=') | |
13 | return *e + l+1; | |
14 | return 0; | |
15 | } |
Note:
See TracBrowser
for help on using the repository browser.