From 6f4b096ba1cff30c1c33dd887aa70740be7990c7 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Fri, 28 Aug 2020 14:46:35 +0200 Subject: Multiline added for && --- src/m_loop_next.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/m_loop_next.c') diff --git a/src/m_loop_next.c b/src/m_loop_next.c index 9aa7129..1a8d867 100644 --- a/src/m_loop_next.c +++ b/src/m_loop_next.c @@ -60,7 +60,7 @@ static char } char - *m_check_multi_backslash(int32_t fd, char *line, t_msh *msh) + *m_check_multi_backslash(int32_t fd, char line[], t_msh *msh) { if (line[ft_strlen(line) - 1] == '\\') { @@ -71,13 +71,13 @@ char } char - *m_check_multi_pipe(int32_t fd, char *line, t_msh *msh) + *m_check_multi_pipe(int32_t fd, char line[], t_msh *msh) { char *pipe; if ((pipe = ft_strrchr(line, '|')) != NULL) { - pipe++; + pipe += 1; while (*pipe != '\0') { if (ft_isspace(*pipe) == FALSE) @@ -93,3 +93,26 @@ char return (line); } +char + *m_check_multi_and(int32_t fd, char line[], t_msh *msh) +{ + char *and; + + if ((and = ft_strrchr(line, '&')) != NULL && *(and - 1) == '&') + { + and += 1; + while (*and != '\0') + { + if (ft_isspace(*and) == FALSE) + { + return (line); + } + and++; + } + line = m_counter_line_pipes(fd, 2, line, msh); + line = m_check_multi_backslash(fd, line, msh); + line = m_check_multi_pipe(fd, line, msh); + line = m_check_multi_and(fd, line, msh); + } + return (line); +} -- cgit v1.2.3