summaryrefslogtreecommitdiffstats
path: root/src/e_builtins.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/e_builtins.c14
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