From ac198727e91b018ea0b8bb84703da48c875ba784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Mon, 21 Apr 2025 15:12:25 +0200 Subject: [PATCH] feat(postprocess): show error when post-processing failure occurs --- src/executing/simple_cmd/simple_cmd_execute.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/executing/simple_cmd/simple_cmd_execute.c b/src/executing/simple_cmd/simple_cmd_execute.c index ec9e0b0..6d5e04d 100644 --- a/src/executing/simple_cmd/simple_cmd_execute.c +++ b/src/executing/simple_cmd/simple_cmd_execute.c @@ -6,10 +6,11 @@ /* By: khais +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/03/27 16:21:56 by khais #+# #+# */ -/* Updated: 2025/04/22 13:14:33 by khais ### ########.fr */ +/* Updated: 2025/04/22 15:38:00 by khais ### ########.fr */ /* */ /* ************************************************************************** */ +#include "../../ft_errno.h" #include "simple_cmd_execute.h" #include "builtins.h" #include "subprocess.h" @@ -79,8 +80,13 @@ void simple_cmd_execute(t_simple_cmd *cmd, t_minishell *app, { if (cmd == NULL || cmd->words == NULL || cmd->words->word == NULL) return ; + ft_errno(FT_ESUCCESS); if (post_process_command(cmd, app) == NULL) + { + if (ft_errno_get() != FT_ESUCCESS) + ft_dprintf(STDERR_FILENO, "minishell: post-processing error\n"); return ; + } simple_cmd_execute_debug(cmd, app); if (handle_redirections(cmd, app) == NULL) return ;