summaryrefslogtreecommitdiffstats
path: root/src/ft_p_line.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 22:24:25 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 22:24:25 +0200
commitfe24a254415b38952eeef8f0ca4e830549360850 (patch)
treef51808f7ed9ccc7840878de4d1c9d5408c6eaa45 /src/ft_p_line.c
parentWrong address (diff)
download42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.gz
42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.bz2
42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.xz
42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.tar.zst
42-minishell-fe24a254415b38952eeef8f0ca4e830549360850.zip
Pretty good start
Diffstat (limited to '')
-rw-r--r--src/ft_p_line.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ft_p_line.c b/src/ft_p_line.c
index ddaf0bd..606408b 100644
--- a/src/ft_p_line.c
+++ b/src/ft_p_line.c
@@ -21,14 +21,21 @@ void
ft_p_line(char line[],
t_msh *msh)
{
- int64_t ret;
+ uint64_t i;
+ uint64_t count;
- if ((ret = ft_strlchr(line, ';') < 0))
+ i = 0;
+ count = 0;
+ while (line[i] != '\0')
{
- if (ft_p_lcom(line, 1, msh) < 0)
+ if (line[i] == ';')
{
- exit(FT_RET_ALLOC);
+ count++;
}
+ i++;
+ }
+ if (ft_p_lcom(line, count, msh) < 0)
+ {
+ exit(FT_RET_ALLOC);
}
- /* TODO: fun */
}