summaryrefslogtreecommitdiffstats
path: root/src/ft_p_line.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 18:46:17 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-20 18:46:17 +0200
commit3349e8a37a9fdf78b82d6df1d310e39c78fcebb2 (patch)
tree88ec7499dbdd45293ae63b5b353c849e50c166e8 /src/ft_p_line.c
parentCool funptr (diff)
download42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.gz
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.bz2
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.xz
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.tar.zst
42-minishell-3349e8a37a9fdf78b82d6df1d310e39c78fcebb2.zip
Trying linked lists
Diffstat (limited to 'src/ft_p_line.c')
-rw-r--r--src/ft_p_line.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ft_p_line.c b/src/ft_p_line.c
index 70699a6..8d75547 100644
--- a/src/ft_p_line.c
+++ b/src/ft_p_line.c
@@ -10,12 +10,23 @@
/* */
/* ************************************************************************** */
+#include <libft.h>
+#include <stdlib.h>
+#include "ft_d_enum.h"
#include "ft_p_line.h"
#include "ft_s_struct.h"
void
- ft_p_line(char *line, t_msh *msh)
+ ft_p_line(char line[],
+ t_msh *msh)
{
- (void)line;
- (void)msh;
+ int64_t ret;
+
+ if ((ret = ft_strlchr(line, ';') < 0))
+ {
+ if (ft_p_lcom(line, 1, msh) < 0)
+ {
+ exit(FT_RET_ALLOC);
+ }
+ }
}