bug fix env -i && cd error message

This commit is contained in:
Tanguy MAZE
2020-02-14 12:22:35 +01:00
parent 7db099a010
commit b9c1a344b2
6 changed files with 31 additions and 10 deletions

View File

@@ -27,3 +27,18 @@ t_env *ft_envnew(char *env)
ft_envdelelem(&ret);
return (ret);
}
t_env *ft_envnewinit(char *key, char *val, t_env *env)
{
t_env *ret;
int i;
i = 0;
ret = NULL;
if ((ret = (t_env*)ft_memalloc(sizeof(t_env))) != NULL)
if ((ret->key = ft_strdup(key)) != NULL)
if ((ret->val = ft_strdup(val)) != NULL)
return (ret);
ft_envdelelem(&ret);
return (ret);
}