heredoc debug en cours

This commit is contained in:
Antoine Riard 2017-03-11 18:50:38 +01:00
parent 84f83bb14c
commit 2f2b0301b6
5 changed files with 12 additions and 2 deletions

BIN
42sh/read_on_stdin Executable file

Binary file not shown.

3
42sh/simple_text_file Normal file
View file

@ -0,0 +1,3 @@
LINE_1
LINE_2
LINE_3

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/17 16:39:05 by ariard #+# #+# */ /* Created: 2017/02/17 16:39:05 by ariard #+# #+# */
/* Updated: 2017/03/11 17:28:03 by ariard ### ########.fr */ /* Updated: 2017/03/11 18:41:34 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/08 16:21:05 by ariard #+# #+# */ /* Created: 2017/03/08 16:21:05 by ariard #+# #+# */
/* Updated: 2017/03/11 16:20:21 by ariard ### ########.fr */ /* Updated: 2017/03/11 18:50:14 by ariard ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -32,10 +32,17 @@ int pop_heredoc(t_list **lst)
temp2 = temp->next; temp2 = temp->next;
free(temp); free(temp);
data_singleton()->heredoc_queue = temp2; data_singleton()->heredoc_queue = temp2;
DG("type is :%s", read_state(head->type));
DG("heredoc data after clear: %s", head->heredoc_data);
} }
else else
{
DG("type is :%s", read_state(head->type));
head->heredoc_data = ft_strjoin(head->heredoc_data, head->heredoc_data = ft_strjoin(head->heredoc_data,
token->data); token->data);
head->heredoc_data = ft_strjoin(head->heredoc_data, "\n");
DG("heredoc data + one: %s", head->heredoc_data);
}
} }
ft_lstdel(lst, &token_free); ft_lstdel(lst, &token_free);
return (1); return (1);

BIN
42sh/write_on_stdout_and_stderr Executable file

Binary file not shown.