From b502364a670956e95836ead7680024b7ff038eac Mon Sep 17 00:00:00 2001 From: Etienne Rey-bethbeder Date: Fri, 14 Apr 2023 19:14:31 +0200 Subject: [PATCH] _ --- builtins/export.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/builtins/export.c b/builtins/export.c index 8ab199f..293f3d3 100644 --- a/builtins/export.c +++ b/builtins/export.c @@ -6,7 +6,7 @@ /* By: cchauvet next != NULL) { - write(fd, "declare -x ", 11); - ft_putstr_fd(((t_env *)(current->content))->key, fd); - if (((t_env *)(current->content))->value != NULL) + if (ft_strcmp(((t_env *)(current->content))->key, "_")) { - ft_putstr_fd("=", fd); - write(fd, "\"", 1); - ft_putstr_fd(((t_env *)(current->content))->value, fd); - write(fd, "\"\n", 2); + write(fd, "declare -x ", 11); + ft_putstr_fd(((t_env *)(current->content))->key, fd); + if (((t_env *)(current->content))->value != NULL) + { + ft_putstr_fd("=", fd); + write(fd, "\"", 1); + ft_putstr_fd(((t_env *)(current->content))->value, fd); + write(fd, "\"\n", 2); + } + else + write(fd, "\n", 2); } - else - write(fd, "\n", 2); current = current->next; } }