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; } }