From 7262c6bb1d1608614700945e87fd5cd9ca6eef32 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 6 Aug 2020 17:51:13 +0200 Subject: In progress, trying to redirect correctly --- src/e_builtins.c | 6 ++++-- src/e_externs.c | 2 +- src/e_lcom.c | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/e_builtins.c b/src/e_builtins.c index 98d54c7..d6ca4f4 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -23,12 +23,14 @@ void e_builtin(const t_lcom *ptr, - uint8_t bu_id, - t_msh *msh) + uint8_t bu_id, + t_msh *msh) { int32_t ret; dup_redirs(ptr, msh); ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); msh->ret = ret; + if (ptr->redir > 0) + close(ptr->rdrfd); } diff --git a/src/e_externs.c b/src/e_externs.c index 93d989f..32596c3 100644 --- a/src/e_externs.c +++ b/src/e_externs.c @@ -64,7 +64,7 @@ void char **envpath; char *fullpath; - if (ft_ischarset("/.", ptr->com[0])) + if (ft_ischarset("./", ptr->com[0])) { exec_path(ptr->com, ptr, msh); return ; diff --git a/src/e_lcom.c b/src/e_lcom.c index e8159fd..30b55d2 100644 --- a/src/e_lcom.c +++ b/src/e_lcom.c @@ -12,6 +12,7 @@ #include #include +#include #include "e_builtins.h" #include "e_externs.h" -- cgit v1.2.3