Browse Source

[mod] simplify debug printing f().

Moul 2 years ago
parent
commit
d862bfe035
2 changed files with 4 additions and 8 deletions
  1. 3 7
      src/pipe_parsing.c
  2. 1 1
      src/sh.h

+ 3 - 7
src/pipe_parsing.c

@@ -51,14 +51,10 @@ void	pipe_init_2(t_e *e, t_pipe *p, char *all_cmd)
 ** display content on structure
 */
 
-void	display_data(t_pipe_redir **t)
+void	display_data(t_pipe_redir *t)
 {
-	int		i;
-
-	i = -1;
-	while (t[++i] != NULL)
-		ft_printf("itxt: '%s', ifd: %d, operator: '%s', ofd: %d, otxt: '%s'\n",
-			t[i]->itxt, t[i]->ifd, t[i]->operator, t[i]->ofd, t[i]->otxt);
+	ft_printf("itxt: '%s', ifd: %d, operator: '%s', ofd: %d, otxt: '%s'\n",
+		t->itxt, t->ifd, t->operator, t->ofd, t->otxt);
 }
 
 /*

+ 1 - 1
src/sh.h

@@ -39,7 +39,7 @@ void	count_pipe_nbr(t_e *e, t_pipe *p, char *str);
 */
 void	fill_pipe_redir_data(t_e *e, t_pipe *p, t_pipe_redir **t);
 void	pipe_creation(t_pipe_redir **t, t_pipe *p, char *cmd);
-void	display_data(t_pipe_redir **t);
+void	display_data(t_pipe_redir *t);
 int		parse_double_redir(t_e *e, char *str, t_pipe *p, t_pipe_redir **t);
 int		parse_redirection(t_e *e, t_pipe *p, char *str, t_pipe_redir **t);
 /*