30 lines
1.2 KiB
C
30 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* env.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/14 14:56:02 by cchauvet #+# #+# */
|
|
/* Updated: 2023/02/14 14:58:40 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "../minishell.h"
|
|
|
|
int print_env(t_list **head, int fd)
|
|
{
|
|
t_list *current;
|
|
|
|
current = *head;
|
|
while (current->next != NULL)
|
|
{
|
|
ft_putstr_fd(((t_env *)(current->content))->key, fd);
|
|
ft_putstr_fd("=", fd);
|
|
ft_putstr_fd(((t_env *)(current->content))->value, fd);
|
|
write(fd, "\n", 1);
|
|
current = current->next;
|
|
}
|
|
return (0);
|
|
}
|