Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/ape/lib/ap/gen/getenv.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include <stdlib.h>
2
 
3
extern	char **environ;
4
 
5
char *
6
getenv(const char *name)
7
{
8
	char **p = environ;
9
	char *s1, *s2;
10
 
11
	while (*p != NULL){
12
		for(s1 = (char *)name, s2 = *p++; *s1 == *s2; s1++, s2++)
13
			continue;
14
		if(*s1 == '\0' && *s2 == '=')
15
			return s2+1;
16
	}
17
	return NULL ;
18
}