blob: 918911347240c292b5f5896a1fe1e07e8cc285fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#include <libft.h>
#include <stdlib.h>
#include "ft_s_struct.h"
t_lcom
*ft_lcom_lstnew(const char word[])
{
t_lcom nlcom;
char **words
/* if (!(nlcom = (t_lcom*)malloc(sizeof(t_lcom)))) */
/* { */
/* return (NULL); */
/* } */
if (!(words = ft_split(word, ' ')))
{
return (NULL);
}
nlcom.com = words[0];
nlcom.args = words + 1;
nlcom.next = NULL;
return (&nlcom);
}
|