/* ************************************************************************** */
/*                                                                            */
/*                                                        ::::::::            */
/*   add_enviroment.c                                   :+:    :+:            */
/*                                                     +:+                    */
/*   By: whaffman <whaffman@student.codam.nl>         +#+                     */
/*                                                   +#+                      */
/*   Created: 2025/02/04 16:13:33 by whaffman      #+#    #+#                 */
/*   Updated: 2025/02/04 16:15:35 by whaffman      ########   odam.nl         */
/*                                                                            */
/* ************************************************************************** */

#include "minishell.h"

void	add_enviroment(t_enviroment **enviroment, char *name, char *value)
{
	t_enviroment	*new_enviroment;

	if (name != NULL && value != NULL)
	{
		new_enviroment = malloc(sizeof(t_enviroment));
		if (new_enviroment == NULL)
		{
			perror("malloc");
			return ;
		}
		new_enviroment->name = ft_strdup(name);
		new_enviroment->value = ft_strdup(value);
		new_enviroment->next = *enviroment;
		*enviroment = new_enviroment;
	}
}
