shithub: npe

ref: f69141f76fffc01b11e8c2c74424a8f7a1501fae
dir: /libnpe/setenv.c/

View raw version
#include <u.h>
#include <libc.h>

int
setenv(char *name, char *value, int overwrite)
{
	char *s;

	if(overwrite == 0 && (s = getenv(name)) != nil){
		free(s);
		return 0;
	}

	return putenv(name, value);
}