fix: execute own builtin
This commit is contained in:
parent
370e5149d5
commit
ca18dd4205
Binary file not shown.
4
cmd.c
4
cmd.c
@ -22,6 +22,10 @@ void ft_cmddel(void *ptr)
|
||||
ft_freer_tab_ultimate(1, content->args);
|
||||
if (content->executable != NULL)
|
||||
free(content->executable);
|
||||
if (content->fd_in > 2)
|
||||
close(content->fd_out);
|
||||
if (content->fd_in > 2)
|
||||
close(content->fd_out);
|
||||
free(content);
|
||||
}
|
||||
|
||||
|
@ -153,12 +153,16 @@ int ft_cmds_executor(t_data *data, t_list **cmds)
|
||||
content->fd_out = fds[1];
|
||||
((t_cmd *) current->next->content)->fd_in = fds[0];
|
||||
}
|
||||
exit_code = ft_own_cmd(data, content);
|
||||
if (exit_code == -1)
|
||||
{
|
||||
content->executable = ft_get_executable_path(data,
|
||||
content->executable);
|
||||
if (content->executable != NULL)
|
||||
exit_code = ft_executor(data, content);
|
||||
}
|
||||
else if (exit_code == -2)
|
||||
return (1);
|
||||
if (ft_gen_exit_code_var(data))
|
||||
return (1);
|
||||
if (content->fd_in > 2)
|
||||
|
Loading…
Reference in New Issue
Block a user