feat(postprocess): show error when post-processing failure occurs

This commit is contained in:
Khaïs COLIN 2025-04-21 15:12:25 +02:00
parent 2180909285
commit ac198727e9

View file

@ -6,10 +6,11 @@
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 ;