summaryrefslogtreecommitdiffstats
path: root/src/m_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/m_loop.c')
-rw-r--r--src/m_loop.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/m_loop.c b/src/m_loop.c
index 0be77a2..a2cf621 100644
--- a/src/m_loop.c
+++ b/src/m_loop.c
@@ -45,12 +45,15 @@ static void m_parse_and_run_line(char line[], uint8_t previf, t_msh *msh)
if ((previf == 0) || (previf == 1 && msh->ret == 0)
|| (previf == 2 && msh->ret != 0))
{
- if (p_find_good_pipe(ptr->lblock) == TRUE
- && (s_split_pipes(ptr->lblock, msh)) == NULL)
- break ;
- else if ((msh->com = s_com_new(ptr->lblock, msh)) == NULL)
- break ;
- e_line(msh);
+ if ((p_find_good_pipe(ptr->lblock) == TRUE
+ && (s_split_pipes(ptr->lblock, msh)) == NULL)
+ || (msh->com = s_com_new(ptr->lblock, msh)) == NULL)
+ {
+ previf = ptr->nextif;
+ ptr = ptr->next;
+ continue ;
+ }
+ e_line_block(msh);
if (msh->com != NULL)
s_com_destroy(&msh->com);
if (msh->pipes != NULL)