From f0f19c3c0ab2d03f03a627ae0f2f215b9ddcf43e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Fri, 25 Apr 2025 17:51:54 +0200 Subject: [PATCH] fix(exec/and or): was exiting too soon --- src/executing/connec_cmd/connec_cmd_execute.c | 12 +++-- test.sh | 48 +++++++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/executing/connec_cmd/connec_cmd_execute.c b/src/executing/connec_cmd/connec_cmd_execute.c index e03e089..03a7be9 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/16 16:56:20 by khais ### ########.fr */ +/* Updated: 2025/04/25 17:58:15 by khais ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,17 +19,19 @@ static void connec_and_cmd_execute(t_connec_cmd *cmd, t_minishell *app, bool should_exit) { - cmd_execute(cmd->first, app, should_exit); + (void)should_exit; + cmd_execute(cmd->first, app, false); if (app->last_return_value == 0) - cmd_execute(cmd->second, app, should_exit); + cmd_execute(cmd->second, app, false); } static void connec_or_cmd_execute(t_connec_cmd *cmd, t_minishell *app, bool should_exit) { - cmd_execute(cmd->first, app, should_exit); + (void)should_exit; + cmd_execute(cmd->first, app, false); if (app->last_return_value != 0) - cmd_execute(cmd->second, app, should_exit); + cmd_execute(cmd->second, app, false); } void connec_cmd_execute(t_connec_cmd *cmd, t_minishell *app, diff --git a/test.sh b/test.sh index 45457ee..8973653 100755 --- a/test.sh +++ b/test.sh @@ -1284,4 +1284,52 @@ hello hi EOF +when_run <