summaryrefslogtreecommitdiffstats
path: root/src/m_loop_next.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/m_loop_next.c29
1 files changed, 26 insertions, 3 deletions
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);
+}