diff --git a/src/executing/cmd/cmd_execute.c b/src/executing/cmd/cmd_execute.c index b009d9a..84285c0 100644 --- a/src/executing/cmd/cmd_execute.c +++ b/src/executing/cmd/cmd_execute.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/04 19:26:37 by khais #+# #+# */ -/* Updated: 2025/04/07 10:38:07 by khais ### ########.fr */ +/* Updated: 2025/04/08 16:22:22 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,6 +17,8 @@ void cmd_execute(t_cmd *cmd, t_minishell *app) { + if (cmd == NULL) + return ; if (cmd->type == FT_SIMPLE) simple_cmd_execute(cmd->value.simple, app); if (cmd->type == FT_GROUP) diff --git a/src/executing/connec_cmd/connec_cmd_execute.c b/src/executing/connec_cmd/connec_cmd_execute.c index 29e477f..1ab137e 100644 --- a/src/executing/connec_cmd/connec_cmd_execute.c +++ b/src/executing/connec_cmd/connec_cmd_execute.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/07 10:38:55 by khais #+# #+# */ -/* Updated: 2025/04/07 11:36:57 by khais ### ########.fr */ +/* Updated: 2025/04/09 16:58:44 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -46,6 +46,8 @@ static void connec_pipe_cmd_execute(t_connec_cmd *cmd, t_minishell *app) void connec_cmd_execute(t_connec_cmd *cmd, t_minishell *app) { + if (cmd == NULL) + return ; if (cmd->connector == FT_AND) connec_and_cmd_execute(cmd, app); if (cmd->connector == FT_OR) diff --git a/src/parser/cmd/cmd_debug.c b/src/parser/cmd/cmd_debug.c index 7a6877c..22f41a7 100644 --- a/src/parser/cmd/cmd_debug.c +++ b/src/parser/cmd/cmd_debug.c @@ -6,17 +6,17 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/09 16:53:27 by khais #+# #+# */ -/* Updated: 2025/04/14 15:07:59 by khais ### ########.fr */ +/* Updated: 2025/04/15 13:49:07 by khais ### ########.fr */ /* */ /* ************************************************************************** */ #include "cmd_debug.h" #include "libft.h" #include "../../treedrawing.h" +#include "../redirect/redirect_debug.h" #include "../simple_cmd/simple_cmd.h" #include "../group_cmd/group_cmd_debug.h" #include "../connec_cmd/connec_cmd_debug.h" -#include "../redirect/redirect_debug.h" static void cmd_type_debug(t_cmd_type type, t_buffer *leader, bool is_last) { diff --git a/src/parser/cmd/cmd_destroy.c b/src/parser/cmd/cmd_destroy.c index 9f677b0..b6f2bc9 100644 --- a/src/parser/cmd/cmd_destroy.c +++ b/src/parser/cmd/cmd_destroy.c @@ -6,7 +6,7 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/04/09 16:53:02 by khais #+# #+# */ -/* Updated: 2025/04/14 15:01:23 by khais ### ########.fr */ +/* Updated: 2025/04/15 13:49:15 by khais ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/src/parser/redirect/redirect_debug.c b/src/parser/redirect/redirect_debug.c index 14bae0c..09faa2e 100644 --- a/src/parser/redirect/redirect_debug.c +++ b/src/parser/redirect/redirect_debug.c @@ -76,8 +76,6 @@ void redirect_debug(t_redirect *redirect, t_buffer *leader, bool is_last) ft_printf("redirections = (empty redir list)\n"); else { - single_redirect_debug(redirect, leader, redirect->next == NULL); - redirect = redirect->next; ft_printf("redirections\n"); i = 0; while (redirect != NULL) diff --git a/src/parser/simple_cmd/simple_cmd.c b/src/parser/simple_cmd/simple_cmd.c index e928a80..973e984 100644 --- a/src/parser/simple_cmd/simple_cmd.c +++ b/src/parser/simple_cmd/simple_cmd.c @@ -13,8 +13,8 @@ #include "simple_cmd.h" #include "libft.h" #include "../../treedrawing.h" -#include "../cmd/cmd_destroy.h" #include "../redirect/redirect_debug.h" +#include "../cmd/cmd_destroy.h" /* ** parse a wordlist and yield a simple command.