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.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/m_loop.c b/src/m_loop.c
index c7ca9cc..e658593 100644
--- a/src/m_loop.c
+++ b/src/m_loop.c
@@ -36,12 +36,15 @@
#include "u_utils.h"
#include "u_parse.h"
#include "u_vars.h"
+#include "u_vars_next.h"
static void m_parse_and_run_line(char line[],
unsigned char previf,
t_msh *msh)
{
t_line_block *ptr;
+ size_t i;
+ t_bool pipe;
p_line(line, msh);
ptr = msh->curr;
@@ -50,14 +53,25 @@ static void m_parse_and_run_line(char line[],
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)
- || (msh->com = s_com_new(ptr->lblock, msh)) == NULL)
+ pipe = p_find_good_pipe(ptr->lblock);
+ if ((pipe == TRUE && s_split_pipes(ptr->lblock, msh) == NULL)
+ || (msh->com = s_com_new(ptr->lblock, msh)) == NULL)
{
previf = ptr->nextif;
ptr = ptr->next;
continue ;
}
+ if (msh->com != NULL && pipe == FALSE)
+ {
+ i = 0;
+ while (msh->com->argv != NULL && msh->com->argv[i] != NULL)
+ i++;
+ if (msh->com->argv != NULL && msh->com->argv[0] != NULL)
+ ft_dprintf(1, "\r[%s]\n", msh->com->argv[i]);
+ else
+ ft_dprintf(1, "\r[%s]\n", msh->com->bin);
+ /* u_subst_var_value("$_", const char *newval, msh); */
+ }
e_line_block(msh);
s_com_destroy(&msh->com);
s_lpipes_clear(&msh->pipes);