variables d'environnement dans le parsing
This commit is contained in:
31
ft_exit.c
Normal file
31
ft_exit.c
Normal file
@ -0,0 +1,31 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_exit.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tomoron <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/07 16:04:11 by tomoron #+# #+# */
|
||||
/* Updated: 2024/02/07 16:48:07 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "minishell.h"
|
||||
|
||||
void ft_exit(t_cmd *args)
|
||||
{
|
||||
t_cmd *start;
|
||||
|
||||
start = args;
|
||||
args = args->next;
|
||||
ft_printf("exit\n");
|
||||
if(args && args->next)
|
||||
ft_printf("minishell: exit: too many arguments\n");
|
||||
else
|
||||
{
|
||||
ft_free_cmd(start);
|
||||
if(args)
|
||||
exit((unsigned char)ft_atoi(args->token));
|
||||
exit(g_return_code);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user