diff options
author | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2019-10-30 16:32:46 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p6.le-101.fr> | 2019-10-30 16:32:46 +0100 |
commit | 27ea0240a97d0745dda0f87940bfe5940f9c594c (patch) | |
tree | b64a14ea7c3a8091c8127df3a3f2ed11060f08b4 /src/ft_exit.c | |
parent | New libft, feelsgoodman (diff) | |
download | 42-minishell-27ea0240a97d0745dda0f87940bfe5940f9c594c.tar.gz 42-minishell-27ea0240a97d0745dda0f87940bfe5940f9c594c.tar.bz2 42-minishell-27ea0240a97d0745dda0f87940bfe5940f9c594c.tar.xz 42-minishell-27ea0240a97d0745dda0f87940bfe5940f9c594c.tar.zst 42-minishell-27ea0240a97d0745dda0f87940bfe5940f9c594c.zip |
work work
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)); +} |