42_minishell/src/main.c
2024-04-23 16:02:01 +02:00

32 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/23 14:33:45 by mcolonna #+# #+# */
/* Updated: 2024/04/23 16:00:53 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#include "include.h"
int main(void)
{
t_memclass mc;
t_command command;
int errorstatus;
errorstatus = 0;
while (true)
{
mc = mem_newclass(minishell_error);
command = parse_command(ask_command(mc));
if (command.error)
continue ;
errorstatus = execute_command(command);
mem_freeall(mc);
}
return (errorstatus);
}