From ca2e36781039eb7e9901ccde395600e7af87ff4f Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 15 Sep 2020 19:59:41 +0200 Subject: Huge fixes and stack stuff --- src/e_externs_pipes.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/e_externs_pipes.c') diff --git a/src/e_externs_pipes.c b/src/e_externs_pipes.c index e6252e4..05a2cf7 100644 --- a/src/e_externs_pipes.c +++ b/src/e_externs_pipes.c @@ -16,16 +16,17 @@ #include #include #include +#include #include #include "d_define.h" -#include "e_externs_next.h" #include "f_fail.h" #include "m_redirs.h" #include "s_destroy.h" #include "s_line.h" #include "s_lpipes.h" #include "s_struct.h" +#include "u_path.h" #include "u_utils.h" static uint8_t @@ -143,8 +144,8 @@ void { struct s_lpipes *head; struct s_lpipes *rptr; - char **envpath; char **fullpath; + char tmp[PATH_MAX]; size_t i; size_t pipes; uint8_t bu_id; @@ -163,7 +164,7 @@ void if ((fullpath[i] = ft_strdup(rptr->com->bin)) == NULL) f_alloc_and_destroy_msh(msh); } - else if ((envpath = get_env_path(msh)) != NULL) + else { if ((bu_id = get_builtin_id(rptr->com->bin, msh)) < FT_BUILTINS_COUNT) @@ -172,8 +173,10 @@ void f_alloc_and_destroy_msh(msh); } else - fullpath[i] = search_in_path(rptr->com->bin, envpath, msh); - ft_delwords(envpath); + { + u_search_in_path(tmp, rptr->com->bin, PATH_MAX, msh); + fullpath[i] = ft_strdup(tmp); + } } i++; rptr = rptr->next; -- cgit v1.2.3