summaryrefslogtreecommitdiffstats
path: root/src/b_export_mute.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-06 21:56:20 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-06 21:56:20 +0200
commit4543c3ba3222d47780ad3e091cfe6f3098cc2bca (patch)
treefb8a70bf05464a6fa2c820cc43ea34421340c903 /src/b_export_mute.c
parentCommit from minishell (diff)
download42-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_mute.c')
-rw-r--r--src/b_export_mute.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/b_export_mute.c b/src/b_export_mute.c
index 4969320..ac72a7e 100644
--- a/src/b_export_mute.c
+++ b/src/b_export_mute.c
@@ -16,7 +16,7 @@
#include "b_export.h"
#include "b_export_next.h"
-#include "d_enum.h"
+#include "d_define.h"
#include "f_fail.h"
#include "s_destroy.h"
#include "s_line.h"
@@ -26,12 +26,11 @@
#include "u_vars.h"
uint8_t
- b_export_mute(char *args[],
- t_msh *msh)
+ b_export_mute(char *args[], t_msh *msh)
{
/* TODO: norme */
char **ptr;
- char *varval;
+ char varval[4096];
char fmt[4096];
t_bool next;
uint8_t r;
@@ -52,12 +51,11 @@ uint8_t
{
next = TRUE;
ft_sprintf(fmt, "$%s", *ptr);
- varval = u_get_cstm_vr(fmt, msh);
- if (varval != NULL)
+ u_get_custom_var(varval, fmt, 4096, msh);
+ if (varval[0] != C_NUL)
{
ft_sprintf(fmt, "%s=%s", *ptr, varval);
b_add_to_env_from_globals(*ptr, fmt, msh);
- ft_memdel((void*)&varval);
}
}
else if (next == FALSE && check_equals(*ptr) == TRUE)