diff --git a/42sh/file b/42sh/file new file mode 100644 index 00000000..614d43df --- /dev/null +++ b/42sh/file @@ -0,0 +1,16 @@ +total 576 +-rwxr-xr-x 1 ariard 2016_paris 249036 Mar 5 17:14 42sh +-rw-r--r-- 1 ariard 2016_paris 8133 Mar 5 16:46 Makefile +-rw-r--r-- 1 ariard 2016_paris 16999 Mar 5 17:15 STDBUG +drwxr-xr-x 7 ariard 2016_paris 238 Mar 4 14:53 TESTSHELL +-rw-r--r-- 1 ariard 2016_paris 4396 Mar 4 14:53 donovan_segaults_06-02 +-rw-r--r-- 1 ariard 2016_paris 0 Mar 5 17:15 file +drwxr-xr-x 16 ariard 2016_paris 544 Mar 5 16:46 includes +drwxr-xr-x 12 ariard 2016_paris 408 Mar 5 16:50 libft +drwxr-xr-x 13 ariard 2016_paris 442 Mar 5 16:50 objs +-rw-r--r-- 1 ariard 2016_paris 0 Mar 4 14:53 parser_init.c +drwxr-xr-x 6 ariard 2016_paris 204 Mar 4 14:53 pdf +drwxr-xr-x 29 ariard 2016_paris 986 Mar 4 14:53 sample +drwxr-xr-x 14 ariard 2016_paris 476 Mar 4 14:53 src +-rwxr-xr-x 1 ariard 2016_paris 890 Mar 4 14:53 test_framework.sh +-rwxr-xr-x 1 ariard 2016_paris 690 Mar 4 14:53 update_makefile.sh diff --git a/42sh/libft b/42sh/libft index 282df927..318efc7c 160000 --- a/42sh/libft +++ b/42sh/libft @@ -1 +1 @@ -Subproject commit 282df927230b2c6da253f8fc9d7ca0eedc0fe30c +Subproject commit 318efc7cfb7b7cc9d3714fa19fd2be7382b6adec diff --git a/42sh/src/exec/ast_free.c b/42sh/src/exec/ast_free.c index 15b0f5b5..93baaec6 100644 --- a/42sh/src/exec/ast_free.c +++ b/42sh/src/exec/ast_free.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/05 11:50:51 by jhalford #+# #+# */ -/* Updated: 2017/03/05 16:50:06 by ariard ### ########.fr */ +/* Updated: 2017/03/05 17:02:27 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/lexer_delim.c b/42sh/src/lexer/lexer_delim.c index 026a0f4a..648aa8a0 100644 --- a/42sh/src/lexer/lexer_delim.c +++ b/42sh/src/lexer/lexer_delim.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/03 11:58:44 by jhalford #+# #+# */ -/* Updated: 2017/02/25 19:56:31 by ariard ### ########.fr */ +/* Updated: 2017/03/05 17:08:23 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/lexer_number.c b/42sh/src/lexer/lexer_number.c index 0d0b2c3b..f429ca83 100644 --- a/42sh/src/lexer/lexer_number.c +++ b/42sh/src/lexer/lexer_number.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/03 12:06:45 by jhalford #+# #+# */ -/* Updated: 2017/03/05 16:48:47 by ariard ### ########.fr */ +/* Updated: 2017/03/05 17:01:04 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/lexer/lexer_word.c b/42sh/src/lexer/lexer_word.c index 066379f2..d10c9e48 100644 --- a/42sh/src/lexer/lexer_word.c +++ b/42sh/src/lexer/lexer_word.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/03 12:07:11 by jhalford #+# #+# */ -/* Updated: 2017/03/03 17:56:07 by jhalford ### ########.fr */ +/* Updated: 2017/03/05 17:07:26 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/parser/add_redir.c b/42sh/src/parser/add_redir.c index 947bd8d5..7a7472c5 100644 --- a/42sh/src/parser/add_redir.c +++ b/42sh/src/parser/add_redir.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/17 16:39:05 by ariard #+# #+# */ -/* Updated: 2017/03/05 16:39:29 by ariard ### ########.fr */ +/* Updated: 2017/03/05 17:14:30 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -87,6 +87,9 @@ int add_redir_type(t_btree **ast, t_list **lst) gen_node(ast); token = (*lst)->content; node = (*ast)->item; + if (!(node->type == TK_IO_NUMBER)) + redir.n = (token->type == TK_LESS || token->type == TK_DLESS + || token->type == TK_LESSAND) ? STDIN : STDOUT; node->type = REDIR; redir.type = token->type; ft_lsteadd(&node->data.cmd.redir, ft_lstnew(&redir, sizeof(redir))); diff --git a/42sh/src/parser/tree_wrapper.c b/42sh/src/parser/tree_wrapper.c index d85ce201..ed89c93e 100644 --- a/42sh/src/parser/tree_wrapper.c +++ b/42sh/src/parser/tree_wrapper.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/15 18:57:44 by ariard #+# #+# */ -/* Updated: 2017/03/05 15:19:25 by ariard ### ########.fr */ +/* Updated: 2017/03/05 16:56:00 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,7 @@ int gen_node(t_btree **ast) ft_bzero((void *)&((t_astnode *)(*ast)->item)->data, sizeof(t_astdata)); ((t_astnode *)(*ast)->item)->nest = 0; ((t_astnode *)(*ast)->item)->full = 0; - ((t_astnode *)(*ast)->item)->type = 0; + ((t_astnode *)(*ast)->item)->type = TK_NEWLINE; ((t_astnode *)(*ast)->item)->pattern = 0; } return (0);