summaryrefslogtreecommitdiffstats
path: root/src/p_lcom.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/p_lcom.c')
-rw-r--r--src/p_lcom.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/p_lcom.c b/src/p_lcom.c
index 339ab17..e65dd3e 100644
--- a/src/p_lcom.c
+++ b/src/p_lcom.c
@@ -19,6 +19,7 @@
#include "d_define.h"
#include "f_fail.h"
+#include "p_split.h"
#include "s_line.h"
#include "s_lpipes.h"
#include "s_struct.h"
@@ -124,22 +125,23 @@ int8_t
int8_t
p_lcom(const char line[],
- const uint64_t count,
- t_msh *msh)
+ const uint64_t count,
+ t_msh *msh)
{
/* TODO: norme */
uint64_t i;
t_line *link;
char **words;
+ char *ptr;
t_bool next;
i = 0;
- if (!(words = ft_split(line, ';')))
+ if ((words = p_split_line(line)) == NULL)
return (-1);
- while (i <= count && words[i])
+ while (i <= count && words[i] != NULL)
{
next = FALSE;
- if (ft_strchr(words[i], '|'))
+ if ((ptr = ft_strchr(words[i], '|')) != NULL)
{
if ((link = s_line_new(NULL, msh)) == NULL)
return (-1);