diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-20 14:51:45 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-20 14:51:45 +0200 |
commit | c9e4fb6e2ad07e13cf41d6ce6afad30b04011765 (patch) | |
tree | 74d816c107c959315ae52166dac96fe2fe0c2a5e /src/ft_exit.c | |
parent | Well well well that wasn't too bad, now remake everything (diff) | |
download | 42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.gz 42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.bz2 42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.xz 42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.tar.zst 42-minishell-c9e4fb6e2ad07e13cf41d6ce6afad30b04011765.zip |
Solid base
Diffstat (limited to '')
-rw-r--r-- | src/ft_exit.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c deleted file mode 100644 index 5285289..0000000 --- a/src/ft_exit.c +++ /dev/null @@ -1,39 +0,0 @@ -/* ************************************************************************** */ -/* LE - / */ -/* / */ -/* ft_exit.c .:: .:/ . .:: */ -/* +:+:+ +: +: +:+:+ */ -/* By: rbousset <marvin@le-101.fr> +:+ +: +: +:+ */ -/* #+# #+ #+ #+# */ -/* Created: 2019/10/30 16:05:48 by rbousset #+# ## ## #+# */ -/* Updated: 2019/11/01 18:47:18 by rbousset ### #+. /#+ ###.fr */ -/* / */ -/* / */ -/* ************************************************************************** */ - -#include <libft.h> -#include <minishell.h> -#include <stdlib.h> - -uint8_t -ft_exit(char **com) -{ - uint8_t i; - - i = 0; - while (com[i]) - i++; - if (i == 2) - { - i = 0; - while (ft_isdigit(com[1][i])) - i++; - if (i != ft_strlen(com[1])) - exit(ft_error(com[0], 255)); - else - exit((uint8_t)ft_atoi(com[1])); - } - else if (i > 2) - return (ft_error(com[0], 1)); - exit(0); -} |