From 93e157bb48e8139e3988b7e0d3deca80dafd51b1 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 27 Aug 2020 15:49:11 +0200 Subject: In progress --- src/e_externs_pipes.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/e_externs_pipes.c b/src/e_externs_pipes.c index 858e60f..320b31d 100644 --- a/src/e_externs_pipes.c +++ b/src/e_externs_pipes.c @@ -26,6 +26,7 @@ #include "s_line.h" #include "s_lpipes.h" #include "s_struct.h" +#include "u_utils.h" static uint8_t get_builtin_id(const char com[], @@ -55,8 +56,10 @@ static void { bu_id = get_builtin_id(ptr->bin, msh); ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); + u_eof_fd(msh->fd); s_line_clear(&msh->curr); s_destroy(msh); + ft_memdel((void*)&fullpath); exit(ret); } else @@ -82,13 +85,13 @@ static size_t static void exec_path(const char *fullpath[], - struct s_lpipes *head, - t_msh *msh) + struct s_lpipes *head, + t_msh *msh) { + int fd[256][2]; size_t pipes; size_t i; size_t j; - int fd[256][2]; int pid; int status; @@ -147,7 +150,7 @@ void head = ptr; rptr = ptr; pipes = e_get_pipes_count(head); - if (!(fullpath = (char **)malloc((pipes + 2) * sizeof(char *)))) + if ((fullpath = (char **)malloc((pipes + 2) * sizeof(char *))) == NULL) f_alloc_and_destroy_msh(msh); fullpath[pipes + 1] = NULL; i = 0; -- cgit v1.2.3