remis Werror dans makefile et resoud warning dans new_token_for_each_field pour le retour de lst_clear

This commit is contained in:
Hugo LAMY
2021-12-20 17:25:36 +01:00
parent 7de89b43b1
commit b8281e329c
6 changed files with 4 additions and 923 deletions

View File

@@ -1,35 +0,0 @@
#include "minishell.h"
// pour imprimer une char ** en precisant comment separer les char *
void print_matrix(char **matrix, char *sep)
{
int i;
i = 0;
while (matrix[i])
{
printf("%s", matrix[i]);
if (matrix[i + 1])
printf("%s", sep);
//fflush(stdout);
i++;
}
write(1, "\n", 1);
}
void print_pipeline(t_cmd **pipeline)
{
int i;
i = 0;
while (pipeline[i])
{
printf("CMD %i, fd_in=%i, fd_out=%i\n", i, pipeline[i]->fd_in, pipeline[i]->fd_out);
ft_putstr_fd(" |", 1);
print_matrix(pipeline[i]->argv, "|\n |");
i++;
if (pipeline[i])
ft_putstr_fd("----------------\n", 1);
}
}

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/07 02:01:33 by lperrey #+# #+# */
/* Updated: 2021/12/20 14:56:05 by hulamy ### ########.fr */
/* Updated: 2021/12/20 17:22:41 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -31,7 +31,8 @@ int new_token_for_each_field(char **fields, t_token *t)
{
perror("insert_token_for_each_field() error");
ft_free_2d_arr(fields);
return ((int)ft_lstclear((t_list **)&head.next, NULL));
ft_lstclear((t_list **)&head.next, NULL);
return (0);
}
insert_lst->content = fields[i];
insert_lst->id = T_WORD;