33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_envclean.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2019/12/06 09:53:25 by tmaze #+# #+# */
|
|
/* Updated: 2019/12/06 09:53:47 by tmaze ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
void ft_envclean(t_env **env)
|
|
{
|
|
t_env **it;
|
|
t_env *tmp;
|
|
|
|
it = env;
|
|
while (*it)
|
|
{
|
|
if (ft_strequ((*it)->val, ""))
|
|
{
|
|
tmp = *it;
|
|
*it = tmp->next;
|
|
ft_envdelelem(&tmp);
|
|
}
|
|
else
|
|
it = &((*it)->next);
|
|
}
|
|
}
|