summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-08-10 19:10:13 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-08-10 19:10:13 +0200
commit83b436aeb610676cd2cd4533ed688319ec08f1d3 (patch)
tree1540a82417cbcbc0af43b6cf6a96f8935a6df6a3 /src
parentPretty damn good one-tap vars (diff)
download42-minishell-83b436aeb610676cd2cd4533ed688319ec08f1d3.tar.gz
42-minishell-83b436aeb610676cd2cd4533ed688319ec08f1d3.tar.bz2
42-minishell-83b436aeb610676cd2cd4533ed688319ec08f1d3.tar.xz
42-minishell-83b436aeb610676cd2cd4533ed688319ec08f1d3.tar.zst
42-minishell-83b436aeb610676cd2cd4533ed688319ec08f1d3.zip
Instant vars TODO done
Diffstat (limited to 'src')
-rw-r--r--src/e_builtins.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/e_builtins.c b/src/e_builtins.c
index bc348fd..7b074af 100644
--- a/src/e_builtins.c
+++ b/src/e_builtins.c
@@ -16,6 +16,7 @@
#include <stdint.h>
#include <unistd.h>
+#include "b_export_next.h"
#include "b_export_mute.h"
#include "m_redirs.h"
#include "s_destroy.h"
@@ -23,12 +24,28 @@
#include "s_struct.h"
static void
+ e_export_env_fork(const t_lcom *ptr,
+ t_msh *msh)
+{
+ char **re_ptr;
+
+ re_ptr = ptr->env_fork;
+ while (*re_ptr != NULL)
+ {
+ b_export_with_equals(*re_ptr, msh);
+ re_ptr++;
+ }
+}
+
+static void
e_builtin_child(const t_lcom *ptr,
uint8_t bu_id,
t_msh *msh)
{
int32_t ret;
+ if (ptr->env_fork != NULL)
+ e_export_env_fork(ptr, msh);
dup_redirs(ptr, msh);
ret = msh->bu_ptr[bu_id](ptr->argv + 1, msh);
lcom_clear(&msh->curr);