#include extern char **environ; /* FIX ME: This is a comptibility func with native9 draw */ char * getenvalloc(const char *name) { char *p,*mp; p=getenv(name); if( p == NULL) return p; mp=malloc(strlen(p)+2); if( ! mp) return NULL; strcat(mp,p); return mp; } char * getenv(const char *name) { char **p = environ; char *s1, *s2; while (*p != NULL){ for(s1 = (char *)name, s2 = *p++; *s1 == *s2; s1++, s2++) continue; if(*s1 == '\0' && *s2 == '=') return s2+1; } return NULL ; }