fix name in pipe

This commit is contained in:
kinou-p 2022-04-09 21:35:37 +02:00
parent d4e928144b
commit 07f9ec1cea

View File

@ -6,7 +6,7 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/02 18:51:31 by apommier #+# #+# */ /* Created: 2022/04/02 18:51:31 by apommier #+# #+# */
/* Updated: 2022/04/09 04:29:40 by apommier ### ########.fr */ /* Updated: 2022/04/09 21:35:09 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -79,7 +79,7 @@ void exec_cmd(t_cmd *cmd, char **env, int *fdpipe)
close(cmd->current_s_cmd->fd[1]); close(cmd->current_s_cmd->fd[1]);
if (is_builtin(cmd->current_s_cmd->cmd)) if (is_builtin(cmd->current_s_cmd->cmd))
{ {
call_builtin(cmd, env); call_builtin(cmd);
exit(0); exit(0);
} }
if (!cmd->current_s_cmd->cmd || access(cmd->current_s_cmd->cmd, F_OK)) if (!cmd->current_s_cmd->cmd || access(cmd->current_s_cmd->cmd, F_OK))
@ -135,7 +135,7 @@ void execute(t_cmd *cmd, char **env)
cmd->current_s_cmd->fd[0] = fdin; cmd->current_s_cmd->fd[0] = fdin;
cmd->current_s_cmd->fd[1] = fdout; cmd->current_s_cmd->fd[1] = fdout;
if (i == 0 && is_builtin(cmd->current_s_cmd->cmd)) if (i == 0 && is_builtin(cmd->current_s_cmd->cmd))
call_builtin(cmd, env); call_builtin(cmd);
else else
exec_cmd(cmd, env, 0); exec_cmd(cmd, env, 0);
} }