redir without IO_NUMBER good

This commit is contained in:
Antoine Riard 2017-03-05 17:20:43 +01:00
parent 9e0c2bd906
commit b6c0355904
8 changed files with 27 additions and 8 deletions

16
42sh/file Normal file
View 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

@ -1 +1 @@
Subproject commit 282df927230b2c6da253f8fc9d7ca0eedc0fe30c
Subproject commit 318efc7cfb7b7cc9d3714fa19fd2be7382b6adec

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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)));

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);