static int my_change_env(t_shell *shell, char *buf) { shell->env = my_add_env(shell->env, "OLDPWD", buf); if (getcwd(buf, 2048) != buf) return (my_put_error("fail getcwd\n")); shell->env = my_add_env(shell->env, "PWD", buf); shell->cd = my_strdup(buf); return (0); }
t_env *my_env_inlist(char **env) { t_env *env_tmp; int i; i = 0; env_tmp = my_create_envlist(); while (env[i] != NULL) { env_tmp = my_add_env(env_tmp, env[i]); i++; } return (env_tmp); }