diff options
Diffstat (limited to 'src/ft_exit.c')
-rw-r--r-- | src/ft_exit.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c new file mode 100644 index 0000000..e09212c --- /dev/null +++ b/src/ft_exit.c @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* LE - / */ +/* / */ +/* ft_exit.c .:: .:/ . .:: */ +/* +:+:+ +: +: +:+:+ */ +/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */ +/* #+# #+ #+ #+# */ +/* Created: 2019/10/30 16:05:48 by rbousset #+# ## ## #+# */ +/* Updated: 2019/10/30 16:05:50 by rbousset ### #+. /#+ ###.fr */ +/* / */ +/* / */ +/* ************************************************************************** */ + +#include <libft.h> +#include <minishell.h> +#include <stdlib.h> + +uint8_t +ft_exit(const char **com) +{ + uint8_t i; + + i = 0; + ft_putendl("exit"); + while (com[i]) + i++; + if (i > 2) + return (ft_error(com[0], 1)); +} |