src/utils/unix_utils.c
/**
 * Gets the environment variable string depending on
 * which one is requested. (basically getvar)
 * 
 * @param var The variable.
 * @param envp The environment variable ptr.
 * @return The variable including the name.
 */
Gets the environment variable string depending on
which one is requested. (basically getvar)

@param var The variable.
@param envp The environment variable ptr.
@return The variable including the name.
Gets the environment variable string depending on which one is requested . ( basically getvar ) @param var The variable . @param envp The environment variable ptr . @return The variable including the name .
char	*ft_getvar(const char *var, char **envp)
{
	t_size	var_len;
	char	*out;
	out = NULL;
	var_len = ft_strlen(var);
	while (*envp)
	{
		if (ft_strnstr(*envp, var, var_len))
			break ;
		envp++;
	}
	return ((*envp) + var_len + 1);
}
char * ft_getvar ( const char * var , char * * envp ) { t_size var_len ; char * out ; out = NULL ; var_len = ft_strlen ( var ) ; while ( * envp ) { if ( ft_strnstr ( * envp , var , var_len ) ) break ; envp ++ ; } return ( ( * envp ) + var_len + 1 ) ; }
Gets the environment variable string depending on
 which one is requested.
Gets the environment variable string depending on which one is requested .