diff options
Diffstat (limited to 'src/p_split.c')
-rw-r--r-- | src/p_split.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/p_split.c b/src/p_split.c new file mode 100644 index 0000000..a53eec9 --- /dev/null +++ b/src/p_split.c @@ -0,0 +1,34 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* p_split.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <stdlib.h> + +static char + **p_split_to_semis(const char line[]) +{ + char **words; + + if ((words = ft_split(line, ';')) == NULL) + return (NULL); + return (words); +} + +char + **p_split_line(const char line[]) +{ + char **words; + + if ((words = p_split_to_semis(line)) == NULL) + return (NULL); + return (words); +} |