added unsetenv built-in + corrected looping Makefile

This commit is contained in:
Tanguy MAZE
2019-01-15 15:18:17 +01:00
parent 36d7fc342d
commit d21269c7ef
4 changed files with 31 additions and 9 deletions

21
srcs/cmd_unsetenv.c Normal file
View File

@@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cmd_unsetenv.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/15 14:58:05 by tmaze #+# #+# */
/* Updated: 2019/01/15 15:04:05 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int cmd_unsetenv(char **argv, t_list **env)
{
if (argv[1] == NULL)
return (-1);
env_delelem(argv[1], env);
return (0);
}