From 85e83d4179e0a0e4d7c07aff750cab9478e461b9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 7 Aug 2020 15:09:31 +0200 Subject: Forked builtins --- src/e_builtins.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/e_builtins.c') diff --git a/src/e_builtins.c b/src/e_builtins.c index 607292e..bc348fd 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -16,6 +16,7 @@ #include #include +#include "b_export_mute.h" #include "m_redirs.h" #include "s_destroy.h" #include "s_lcom.h" @@ -48,8 +49,17 @@ static void while (wait(&status) != pid) ; ret = WEXITSTATUS(status); - if (bu_id != FT_ID_EXIT) - msh->ret = ret; + msh->ret = ret; + if (bu_id == FT_ID_CD && ret == 0) + msh->bu_ptr[bu_id](ptr->argv + 1, msh); + else if (bu_id == FT_ID_EXPORT) + b_export_mute(ptr->argv + 1, msh); + else if (bu_id == FT_ID_EXIT && ret == 0) + { + lcom_clear(&msh->curr); + s_destroy(msh); + exit(ret); + } } void -- cgit v1.2.3