path.c
/**
 * create_path_list - creating singly linked list from path
 * @path: path env value
 * @head: head of list
 * Return: head pointer
 */
creating singly linked list from path
@path: path env value
@head: head of list
Return: head pointer
creating singly linked list from path @path : path env value @head : head of list Return : head pointer
path_node *create_path_list(char *path, path_node **head)
{
	int len;
	path_node *new;
	char *s = _strdup(path);
	if (s == NULL)
		return (NULL);
	for (len = 0; s[len]; len++)
	;
	new = malloc(sizeof(path_node));
	if (new == NULL)
	return (NULL);
	else
	{
		new->path = s;
		new->next = *head;
	}
	*head = new;
	return (new);
}
path_node * create_path_list ( char * path , path_node * * head ) { int len ; path_node * new ; char * s = _strdup ( path ) ; if ( s == NULL ) return ( NULL ) ; for ( len = 0 ; s [ len ] ; len ++ ) ; new = malloc ( sizeof ( path_node ) ) ; if ( new == NULL ) return ( NULL ) ; else { new -> path = s ; new -> next = * head ; } * head = new ; return ( new ) ; }
create_path_list - creating singly linked list from path
 @path: path env value
 @head: head of list
 Return: head pointer
create_path_list - creating singly linked list from path @path : path env value @head : head of list Return : head pointer