diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-10 19:06:30 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-10 19:06:30 +0200 |
commit | d9d98feb999b6f503b5ca330976dc30266016551 (patch) | |
tree | 5763beb8ffddfdf8a562f5a2c8507a3467c4f885 /src/e_externs.c | |
parent | Work in progress (diff) | |
download | 42-minishell-d9d98feb999b6f503b5ca330976dc30266016551.tar.gz 42-minishell-d9d98feb999b6f503b5ca330976dc30266016551.tar.bz2 42-minishell-d9d98feb999b6f503b5ca330976dc30266016551.tar.xz 42-minishell-d9d98feb999b6f503b5ca330976dc30266016551.tar.zst 42-minishell-d9d98feb999b6f503b5ca330976dc30266016551.zip |
Pretty damn good one-tap vars
Diffstat (limited to '')
-rw-r--r-- | src/e_externs.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/e_externs.c b/src/e_externs.c index 7593c3d..0e3c2bb 100644 --- a/src/e_externs.c +++ b/src/e_externs.c @@ -16,6 +16,7 @@ #include <stdint.h> #include <unistd.h> +#include "b_export_next.h" #include "e_externs_next.h" #include "f_fail.h" #include "m_redirs.h" @@ -34,6 +35,20 @@ static void } static void + e_export_env_fork(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 exec_path(const char fullpath[], t_lcom *ptr, t_msh *msh) @@ -43,8 +58,8 @@ static void if ((pid = fork()) == 0) { - /* if (ptr->env_fork != NULL) */ - /* e_export_env_fork(ptr->env_fork, msh); */ + if (ptr->env_fork != NULL) + e_export_env_fork(ptr, msh); e_extern_child(fullpath, ptr, msh); } else if (pid < 0) |