minishell/src/enviroment/get_enviroment.c
2025-02-04 15:57:26 +01:00

16 lines
316 B
C

#include "enviroment.h"
#include "libft.h"
char *get_enviroment(t_enviroment *enviroment, char *name)
{
while (enviroment != NULL)
{
if (ft_strcmp(enviroment->name, name) == 0)
{
return enviroment->value;
}
enviroment = enviroment->next;
}
return NULL;
}