diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-10-22 19:58:27 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-10-22 19:58:27 +0200 |
commit | f498fb6dbbeab4b2993b834a6abd41ba8c2ed316 (patch) | |
tree | 996160c574ef2efb0145fc9cf007404facf3977a /src/m_loop.c | |
parent | Unfinished (diff) | |
download | 42-minishell-f498fb6dbbeab4b2993b834a6abd41ba8c2ed316.tar.gz 42-minishell-f498fb6dbbeab4b2993b834a6abd41ba8c2ed316.tar.bz2 42-minishell-f498fb6dbbeab4b2993b834a6abd41ba8c2ed316.tar.xz 42-minishell-f498fb6dbbeab4b2993b834a6abd41ba8c2ed316.tar.zst 42-minishell-f498fb6dbbeab4b2993b834a6abd41ba8c2ed316.zip |
On the way but norm this shit
Diffstat (limited to 'src/m_loop.c')
-rw-r--r-- | src/m_loop.c | 15 |
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) |