From 0ebdfd7d349d1637dffe60920345d01e03677be5 Mon Sep 17 00:00:00 2001 From: tomoron Date: Tue, 2 Apr 2024 13:51:57 +0200 Subject: [PATCH] glhf marijn --- srcs/commands.c | 20 +------------------- srcs/exec_bonus.c | 18 +----------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/srcs/commands.c b/srcs/commands.c index df38cb2..598b41b 100644 --- a/srcs/commands.c +++ b/srcs/commands.c @@ -6,30 +6,12 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/05 18:22:15 by marde-vr #+# #+# */ -/* Updated: 2024/04/02 02:02:02 by tomoron ### ########.fr */ +/* Updated: 2024/04/02 13:48:48 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -int get_cmd_count(t_token *cmds) -{ - int count; - t_token *cur_cmd; - - count = 0; - cur_cmd = cmds; - while (cur_cmd->next) - { - if (/*cur_cmd->type != PIPE*/ 1) - count++; - cur_cmd = cur_cmd->next; - } - if (/*cur_cmd->type != PIPE */ 1) - count++; - return (count); -} - int get_args_count(t_token *cmds) { int count; diff --git a/srcs/exec_bonus.c b/srcs/exec_bonus.c index 0319d93..d2e0be9 100644 --- a/srcs/exec_bonus.c +++ b/srcs/exec_bonus.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */ -/* Updated: 2024/04/02 13:31:55 by tomoron ### ########.fr */ +/* Updated: 2024/04/02 13:51:42 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -117,19 +117,3 @@ void end_execution(t_msh *msh, int cmd_count) signal(SIGQUIT, signal_handler_interactive); set_echoctl(0); } - -void exec_commands(t_msh *msh) -{ - int cmd_count; - int i; - - i = -1; - cmd_count = get_cmd_count(msh->cmds); - ft_printf("cmd_count: %d\n", cmd_count); - msh->pids = ft_calloc(cmd_count, sizeof(int *)); - if (!msh->pids) - ft_exit(msh, 1); - while (++i < cmd_count) - exec_command(msh, i, cmd_count); - end_execution(msh, cmd_count); -}