fix des trucs

This commit is contained in:
2024-05-07 17:43:00 +02:00
parent 01496f0587
commit e986d8692b
5 changed files with 20 additions and 9 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/28 13:50:14 by tomoron #+# #+# */
/* Updated: 2024/05/07 12:36:41 by tomoron ### ########.fr */
/* Updated: 2024/05/07 17:26:49 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -81,10 +81,8 @@ void exec_command(t_msh *msh, int i, int cmd_count)
if (!msh->fds[i])
ft_exit(msh, 1);
if (msh->tokens && !cmd_is_builtin(msh, msh->tokens->value))
// && msh->in_fd != -1)
get_cmd_path(msh);
if (((msh->tokens && msh->tokens->value) || is_parenthesis(msh->cmds)))
// && msh->in_fd != -1)
exec(msh, get_cmd_args(msh), i, cmd_count);
else
{
@ -136,6 +134,7 @@ void exec_commands(t_msh *msh)
{
get_redirections(msh, msh->cmds);
g_return_code = (msh->in_fd < 0 || msh->out_fd < 0);
remove_here_doc_file(msh);
if (msh->in_fd > 2)
close(msh->in_fd);
if (msh->out_fd > 2)