diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-06 21:56:20 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-06 21:56:20 +0200 |
commit | 4543c3ba3222d47780ad3e091cfe6f3098cc2bca (patch) | |
tree | fb8a70bf05464a6fa2c820cc43ea34421340c903 /src/b_export_next.c | |
parent | Commit from minishell (diff) | |
download | 42-minishell-4543c3ba3222d47780ad3e091cfe6f3098cc2bca.tar.gz 42-minishell-4543c3ba3222d47780ad3e091cfe6f3098cc2bca.tar.bz2 42-minishell-4543c3ba3222d47780ad3e091cfe6f3098cc2bca.tar.xz 42-minishell-4543c3ba3222d47780ad3e091cfe6f3098cc2bca.tar.zst 42-minishell-4543c3ba3222d47780ad3e091cfe6f3098cc2bca.zip |
Stacked
Diffstat (limited to 'src/b_export_next.c')
-rw-r--r-- | src/b_export_next.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/b_export_next.c b/src/b_export_next.c index c46389a..059fbc6 100644 --- a/src/b_export_next.c +++ b/src/b_export_next.c @@ -92,10 +92,9 @@ static void } void - b_export_with_equals(const char arg[], - t_msh *msh) + b_export_with_equals(const char arg[], t_msh *msh) { - char *varval; + char varval[4096]; char **var; int64_t env_i; @@ -105,8 +104,10 @@ void ft_memdel((void*)&msh->envp[env_i]); if ((msh->envp[env_i] = ft_strdup(arg)) == NULL) f_alloc_and_destroy_msh(msh); + return ; } - else if ((varval = u_get_cstm_vr(var[FT_VAR_NAME], msh)) != NULL) + u_get_custom_var(varval, var[FT_VAR_NAME], 4096, msh); + if (varval[0] != C_NUL) { b_add_to_env(arg, msh); lvars_delone(&msh->vars, var[FT_VAR_NAME] + 1); |