mailing list of musl libc
 help / color / mirror / code / Atom feed
cf34672c3d60ae73d245f011a3716385c7ce3b2e blob 325 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
 
#include <stdlib.h>
#include <string.h>
#include "libc.h"

char *__strchrnul(const char *, int);

char *getenv(const char *name)
{
	size_t l = __strchrnul(name, '=') - name;
	if (l && !name[l] && __environ)
		for (char **e = __environ; *e; e++)
			if (!strncmp(name, *e, l) && l[*e] == '=')
				return *e + l+1;
	return 0;
}
debug log:

solving cf34672 ...
found cf34672 in https://git.vuxu.org/mirror/musl/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).