feature: switched env from ft_list to specific list

This commit is contained in:
Tanguy MAZE
2019-09-26 16:54:52 +02:00
parent 05d8424f75
commit aa8e971688
9 changed files with 128 additions and 89 deletions

View File

@@ -6,28 +6,28 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/20 14:33:48 by tmaze #+# #+# */
/* Updated: 2019/09/20 15:02:22 by tmaze ### ########.fr */
/* Updated: 2019/09/26 15:20:58 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
static void put_env(t_list *env)
static void put_env(t_env *env)
{
t_list *it;
t_env *it;
it = env;
while (it)
{
ft_printf("%s=", ((char**)it->content)[0]);
if (((char**)it->content)[1])
ft_printf("%s", ((char**)it->content)[1]);
ft_printf("%s=", it->key);
if (it->val)
ft_printf("%s", it->val);
ft_putchar('\n');
it = it->next;
}
}
int cmd_env(char** argv, t_list** env)
int cmd_env(char** argv, t_env** env)
{
if (!argv[1])
put_env(*env);