- char **env = prom_envp;
- int i = strlen(envname);
- int yamon = (*env && strchr(*env, '=') == NULL);
-
- while (*env) {
- if (yamon) {
- if (strcmp(envname, *env++) == 0)
- return *env;
- } else {
- if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=')
- return *env + i + 1;
+ t_env_var *env = (t_env_var *)prom_envp;
+ int i;
+
+ i = strlen(envname);
+
+ while(env->name) {
+ if(strncmp(envname, env->name, i) == 0) {
+ return(env->name + strlen(envname) + 1);