summaryrefslogtreecommitdiffstats
path: root/src/p_split.c
blob: a53eec98600339409e8b886f35cb3c5d1ed4c5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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);
}