bug fix env -i && cd error message
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user