-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode_cpy.c
More file actions
31 lines (28 loc) · 1.2 KB
/
node_cpy.c
File metadata and controls
31 lines (28 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* node_cpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mamoussa <mamoussa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/28 12:08:29 by mamoussa #+# #+# */
/* Updated: 2020/12/10 16:45:16 by mamoussa ### ########.fr */
/* */
/* ************************************************************************** */
#include "shell.h"
t_env *node_cpy(void)
{
t_env *head_cpy;
t_env *current;
t_env *new_node;
current = g_env_head;
head_cpy = NULL;
while (current)
{
new_node = ft_lstnewenv(ft_strdup(current->key),
ft_strdup(current->value));
ft_lstadd_backenv(&head_cpy, new_node);
current = current->next;
}
return (head_cpy);
}