diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-07 15:09:31 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-07 15:09:31 +0200 |
commit | 85e83d4179e0a0e4d7c07aff750cab9478e461b9 (patch) | |
tree | 1eb28924de62c9348259b9012b8606d67008ad83 /src/e_builtins.c | |
parent | Old style rewrite in progress (diff) | |
download | 42-minishell-85e83d4179e0a0e4d7c07aff750cab9478e461b9.tar.gz 42-minishell-85e83d4179e0a0e4d7c07aff750cab9478e461b9.tar.bz2 42-minishell-85e83d4179e0a0e4d7c07aff750cab9478e461b9.tar.xz 42-minishell-85e83d4179e0a0e4d7c07aff750cab9478e461b9.tar.zst 42-minishell-85e83d4179e0a0e4d7c07aff750cab9478e461b9.zip |
Forked builtins
Diffstat (limited to 'src/e_builtins.c')
-rw-r--r-- | src/e_builtins.c | 14 |
1 files changed, 12 insertions, 2 deletions
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 <stdint.h> #include <unistd.h> +#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 |