summaryrefslogtreecommitdiffstats
path: root/src/ft_e_builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_e_builtins.c')
-rw-r--r--src/ft_e_builtins.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ft_e_builtins.c b/src/ft_e_builtins.c
index bc3eece..1045856 100644
--- a/src/ft_e_builtins.c
+++ b/src/ft_e_builtins.c
@@ -16,6 +16,7 @@
#include <stdint.h>
#include <unistd.h>
+#include "ft_b_builtins.h"
#include "ft_m_redirs.h"
#include "ft_s_destroy.h"
#include "ft_s_lcom.h"
@@ -37,6 +38,8 @@ static void
static void
ft_e_builtin_parent(pid_t pid,
+ const t_lcom *ptr,
+ uint8_t bu_id,
t_msh *msh)
{
int32_t status;
@@ -44,6 +47,10 @@ static void
while (wait(&status) != pid)
;
msh->ret = WEXITSTATUS(status);
+ if (bu_id == 1 && msh->ret == 0)
+ {
+ ft_b_cd(ptr->argv + 1, msh);
+ }
}
void
@@ -64,6 +71,6 @@ void
}
else
{
- ft_e_builtin_parent(pid, msh);
+ ft_e_builtin_parent(pid, ptr, bu_id, msh);
}
}