diff options
Diffstat (limited to '')
-rw-r--r-- | src/p_lcom.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/p_lcom.c b/src/p_lcom.c index e65dd3e..0e849a0 100644 --- a/src/p_lcom.c +++ b/src/p_lcom.c @@ -125,7 +125,6 @@ int8_t int8_t p_lcom(const char line[], - const uint64_t count, t_msh *msh) { /* TODO: norme */ @@ -133,13 +132,21 @@ int8_t t_line *link; char **words; char *ptr; + uint8_t nextif; t_bool next; i = 0; if ((words = p_split_line(line)) == NULL) return (-1); - while (i <= count && words[i] != NULL) + while (words[i] != NULL) { + if (words[i][ft_strlen(words[i]) - 1] == ';') + nextif = 0; + else if (words[i][ft_strlen(words[i]) - 1] == '&') + nextif = 1; + else + nextif = 2; + words[i][ft_strlen(words[i]) - 1] = '\0'; next = FALSE; if ((ptr = ft_strchr(words[i], '|')) != NULL) { @@ -151,6 +158,7 @@ int8_t } if (next == FALSE && (link = s_line_new(words[i], msh)) == NULL) return (-1); + link->nextif = nextif; s_line_add_back(&msh->curr, link); i++; } |