Archived
1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
pipex/src/utils/getpath.c
2024-04-08 12:54:24 +02:00

31 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* getpath.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/04 15:32:56 by adjoly #+# #+# */
/* Updated: 2024/04/07 16:20:05 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipex.h"
void getpath(t_pipex *pipex)
{
char **env;
env = pipex->env;
while (*env)
{
if (!ft_strncmp(*env, "PATH=", 5))
{
pipex->path = ft_split((*env) + 5, ':');
return ;
}
env++;
}
pipex->path = NULL;
}