/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* cmd_setenv.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tmaze +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/09/20 14:41:08 by tmaze #+# #+# */ /* Updated: 2019/10/10 14:31:47 by tmaze ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" int cmd_setenv(char** argv, t_env** env) { t_env *new; if (argv[1] && (new = lstnew(argv[1])) != NULL) { lstaddend(env, new); return (0); } else if (argv[1]) { ft_printf("minishell: setenv: memory error\n"); return (2); } else { printf("usage: setenv [KEY]=[value]\n"); return (1); } }