diff options
Diffstat (limited to 'src/e_builtins.c')
-rw-r--r-- | src/e_builtins.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/e_builtins.c b/src/e_builtins.c index 18abc16..90e436e 100644 --- a/src/e_builtins.c +++ b/src/e_builtins.c @@ -16,9 +16,12 @@ #include <stdint.h> #include <unistd.h> +#include "b_builtins.h" #include "b_export_next.h" #include "b_export_mute.h" +#include "m_loop.h" #include "m_redirs.h" +#include "s_com.h" #include "s_destroy.h" #include "s_line.h" #include "s_struct.h" @@ -49,7 +52,8 @@ static void e_export_env_fork(ptr, msh); dup_redirs(ptr, msh); ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh); - u_eof_stdin(); + u_eof_fd(msh->fd); + s_com_destroy(&msh->com); s_line_clear(&msh->curr); s_destroy(msh); exit(ret); @@ -64,7 +68,6 @@ static void int32_t status; int32_t ret; - (void)ptr; while (wait(&status) != pid) ; ret = WEXITSTATUS(status); @@ -75,8 +78,13 @@ static void b_export_mute(ptr->argv + 1, msh); else if (bu_id == FT_ID_UNSET) msh->bu_ptr[bu_id](ptr->argv + 1, msh); - else if (bu_id == FT_ID_EXIT && ret == 0) + else if (bu_id == FT_ID_ALIAS) + b_alias_mute(ptr->argv + 1, msh); + else if (bu_id == FT_ID_EXIT) { + if (msh->fd == STDIN_FILENO) + m_dump_hist(msh); + s_com_destroy(&msh->com); s_line_clear(&msh->curr); s_destroy(msh); exit(ret); |