diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-14 15:24:12 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-14 15:24:12 +0200 |
commit | 294adc19078fa8d196ee1d787ec24619f9976178 (patch) | |
tree | 9446807d7ee909046f1cb9f2bd1c7711bbe0b857 /src/p_split.c | |
parent | Removed bloat (diff) | |
download | 42-minishell-294adc19078fa8d196ee1d787ec24619f9976178.tar.gz 42-minishell-294adc19078fa8d196ee1d787ec24619f9976178.tar.bz2 42-minishell-294adc19078fa8d196ee1d787ec24619f9976178.tar.xz 42-minishell-294adc19078fa8d196ee1d787ec24619f9976178.tar.zst 42-minishell-294adc19078fa8d196ee1d787ec24619f9976178.zip |
I must split
Diffstat (limited to '')
-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); +} |