From 4793df800dea8085d384bec200698e3057faaae1 Mon Sep 17 00:00:00 2001 From: yosyo Date: Sat, 6 Jul 2024 12:04:14 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=E2=9C=A8=E3=80=8D=20feat(exec=5Fbuilt?= =?UTF-8?q?ins):=20fixed=20builtins=20exec=20from=20a=20fork?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/exec/exec_split_cmd.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/exec/exec_split_cmd.c b/src/exec/exec_split_cmd.c index 1e9f5fe..0bcd055 100644 --- a/src/exec/exec_split_cmd.c +++ b/src/exec/exec_split_cmd.c @@ -6,7 +6,7 @@ /* By: mmoussou 4) + exit(0); } else execve(cmd, argv, env); @@ -97,6 +98,10 @@ int exec_single_cmd(t_cmd *cmd, char **env, t_env *env_t, int pipe_fd[2]) printf("minishell : command not found: %s\n", input); return (-1); } + if (is_in_builtins(cmd->cmd) < 5) + { + exec_cmd(cmd->cmd, cmd->argv, env, env_t); + } fork_pid = fork(); if (!fork_pid) {