doing pipe + lst cmds
This commit is contained in:
parent
722a290aee
commit
37d9898f59
27 changed files with 73 additions and 48 deletions
0
42sh/file1
Normal file
0
42sh/file1
Normal file
14
42sh/file2
Normal file
14
42sh/file2
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
total 576
|
||||
-rwxr-xr-x 1 ariard 2016_paris 690 Feb 21 15:30 update_makefile.sh
|
||||
drwxr-xr-x 13 ariard 2016_paris 442 Feb 21 15:30 src
|
||||
drwxr-xr-x 28 ariard 2016_paris 952 Feb 25 18:21 sample
|
||||
drwxr-xr-x 6 ariard 2016_paris 204 Feb 21 15:30 pdf
|
||||
drwxr-xr-x 13 ariard 2016_paris 442 Mar 2 20:15 objs
|
||||
drwxr-xr-x 12 ariard 2016_paris 408 Mar 2 20:15 libft
|
||||
drwxr-xr-x 19 ariard 2016_paris 646 Mar 2 20:36 includes
|
||||
-rw-r--r-- 1 ariard 2016_paris 0 Mar 2 20:40 file2
|
||||
-rw-r--r-- 1 ariard 2016_paris 0 Mar 2 20:40 file1
|
||||
-rw-r--r-- 1 ariard 2016_paris 4396 Feb 21 15:40 donovan_segaults_06-02
|
||||
-rw-r--r-- 1 ariard 2016_paris 21985 Mar 2 20:39 STDBUG
|
||||
-rw-r--r-- 1 ariard 2016_paris 8051 Mar 1 16:42 Makefile
|
||||
-rwxr-xr-x 1 ariard 2016_paris 246884 Mar 2 20:38 42sh
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/01 12:15:54 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/01 22:39:00 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 22:02:15 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ struct s_cmd
|
|||
|
||||
union u_astdata
|
||||
{
|
||||
t_cmd cmd;
|
||||
t_list *cmds;
|
||||
t_list *wordlist;
|
||||
char **sstr;
|
||||
char *str;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/13 17:11:48 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/01 22:39:16 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 20:36:25 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -159,6 +159,7 @@ enum e_sym
|
|||
FUNC_NAME,
|
||||
CLOSE_LIST,
|
||||
REDIR,
|
||||
JOB,
|
||||
ALL = 200,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit bfc8ca207ab4d39f0140322c0f1d368137304a3c
|
||||
Subproject commit 8f6e64fa9b4ac1dd3e3d5200fb93471ddfeedd40
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/05 11:50:51 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/01 16:36:20 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:54 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -19,6 +19,8 @@ void ast_free(void *data, size_t content_size)
|
|||
(void)node;
|
||||
(void)data;
|
||||
(void)content_size;
|
||||
|
||||
return ;
|
||||
/*
|
||||
(void)content_size;
|
||||
node = data;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/28 18:36:21 by jhalford #+# #+# */
|
||||
/* Updated: 2017/02/25 20:39:29 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/01 23:40:16 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/03 12:06:45 by jhalford #+# #+# */
|
||||
/* Updated: 2017/02/25 20:39:33 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/01 23:39:37 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -29,12 +29,20 @@ int lexer_number(t_list **alst, t_lexer *lexer)
|
|||
lexer->state = state;
|
||||
return (lexer_lex(alst, lexer));
|
||||
}
|
||||
else if (ft_isdigit(lexer->str[lexer->pos]))
|
||||
else if (ft_isdigit(lexer->str[lexer->pos])
|
||||
&& (lexer->str[lexer->pos + 1] == '>' || lexer->str[lexer->pos + 1] == '<'))
|
||||
{
|
||||
token_append(token, lexer, 0, 0);
|
||||
lexer->pos++;
|
||||
return (lexer_number(alst, lexer));
|
||||
}
|
||||
else
|
||||
{
|
||||
token->type = TK_WORD;
|
||||
token_append(token, lexer, 0, 0);
|
||||
lexer->pos++;
|
||||
return (lexer_lex(alst, lexer));
|
||||
}
|
||||
lexer->state = DEFAULT;
|
||||
return (lexer_lex(alst, lexer));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/03 12:07:11 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/01 14:06:03 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/01 23:32:59 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/11/14 18:18:04 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/01 15:56:54 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 20:39:36 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -17,6 +17,8 @@ char *ft_putast(void *nodein)
|
|||
t_astnode *node;
|
||||
node = nodein;
|
||||
|
||||
if (node->type == JOB)
|
||||
return ("JOB");
|
||||
if (node->type == REDIR)
|
||||
return ("REDIR");
|
||||
if (node->type == CLOSE_LIST)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/01 22:59:40 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:50 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -63,12 +63,12 @@ int handle_instruction(int fd)
|
|||
else if (parser.state == ERROR)
|
||||
error_syntax(&token);
|
||||
token = NULL;
|
||||
ast = NULL;
|
||||
}
|
||||
DG("succesful parsing:");
|
||||
btree_print(STDBUG, ast, &ft_putast);
|
||||
/* if (ft_exec(&ast)) */
|
||||
/* return (1); */
|
||||
btree_del(&ast, &ast_free);
|
||||
ft_add_str_in_history(lexer.str);
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/15 20:49:15 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 22:46:31 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:53:48 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -45,17 +45,18 @@ int add_cmd(t_btree **ast, t_list **lst)
|
|||
else if (isfunc(ast, lst))
|
||||
return (add_func_cmd(ast, lst));
|
||||
else if ((node = (*ast)->item)->type != TK_DO && node->type != TK_THEN
|
||||
&& node->type != TK_PAREN_CLOSE && node->type != TK_WORD
|
||||
&& node->type != TK_PAREN_CLOSE && node->type != JOB
|
||||
&& node->type != REDIR)
|
||||
return (add_cmd(&(*ast)->right, lst));
|
||||
my_tab = NULL;
|
||||
node = (*ast)->item;
|
||||
node->type = token->type;
|
||||
node->type = JOB;
|
||||
if (token->type == TK_WORD || token->type == TK_ASSIGNEMENT_WORD)
|
||||
{
|
||||
DG("add data");
|
||||
my_tab = ft_sstradd(my_tab, token->data);
|
||||
my_tab = ft_sstradd(my_tab, (char *)token->esc);
|
||||
my_tab = ft_sstradd(my_tab, (char *)token->esc2);
|
||||
ft_ld_pushback(&node->data.cmd.token, my_tab);
|
||||
}
|
||||
return (0);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/19 18:12:52 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 15:59:58 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:59 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/24 23:43:07 by ariard #+# #+# */
|
||||
/* Updated: 2017/02/25 00:32:00 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:41:01 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/17 22:17:14 by ariard #+# #+# */
|
||||
/* Updated: 2017/02/25 19:18:01 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:41:02 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/17 16:39:05 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 22:44:53 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 22:01:51 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ int isdir_sep(t_btree **ast, t_list **list)
|
|||
if (*ast)
|
||||
{
|
||||
node = (*ast)->item;
|
||||
if ((node->type == TK_WORD || node->type == REDIR)
|
||||
if (node->type == JOB
|
||||
&& (token->type == TK_LESS || token->type == TK_GREAT
|
||||
|| token->type == TK_GREATAND || token->type == TK_LESSAND
|
||||
|| token->type == TK_DLESS || token->type == TK_DGREAT))
|
||||
|
|
@ -47,7 +47,7 @@ int isdir_word(t_btree **ast, t_list **list)
|
|||
{
|
||||
node = (*ast)->item;
|
||||
if (token->type == TK_WORD && node->type == REDIR)
|
||||
return (1);
|
||||
return ((node->type = JOB));
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/15 19:12:07 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 18:02:14 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:41:07 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/24 18:41:50 by ariard #+# #+# */
|
||||
/* Updated: 2017/02/24 23:38:40 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:41:11 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -19,7 +19,6 @@ int issubshell(t_btree **ast, t_list **lst)
|
|||
|
||||
node = NULL;
|
||||
token = (*lst)->content;
|
||||
DG("test loop");
|
||||
if (*ast)
|
||||
{
|
||||
node = (*ast)->item;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/09 17:39:18 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 22:55:14 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:41:13 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -107,6 +107,7 @@ t_aggrematch g_aggrematch[] =
|
|||
{IO_HERE, TK_IO_NUMBER, IO_REDIRECT, TK_IO_NUMBER},
|
||||
{IO_HERE, ALL, IO_REDIRECT, 0},
|
||||
{IO_REDIRECT, CMD_SUPERIOR, CMD_SUPERIOR, CMD_SUPERIOR},
|
||||
{IO_REDIRECT, PIPE_SEMI_SEQUENCE, PIPE_SEMI_SEQUENCE, PIPE_SEMI_SEQUENCE},
|
||||
{IO_REDIRECT, COMPOUND_COMMAND, REDIRECT_LIST, REDIRECT_LIST},
|
||||
|
||||
//to check
|
||||
|
|
@ -305,20 +306,20 @@ int aggregate_sym(t_sym **stack, t_sym *new_sym, t_parstate *state)
|
|||
int i;
|
||||
|
||||
i = 0;
|
||||
DG("aggregate head %s && sym %s",
|
||||
read_state(**stack), read_state(*new_sym));
|
||||
// DG("aggregate head %s && sym %s",
|
||||
// read_state(**stack), read_state(*new_sym));
|
||||
while (g_aggrematch[i].top)
|
||||
{
|
||||
if (*new_sym == g_aggrematch[i].top
|
||||
&& MATCH_STACK(**stack, g_aggrematch[i].under))
|
||||
|
||||
{
|
||||
DG("MATCH : %s", read_state(g_aggrematch[i].new_sym));
|
||||
// DG("MATCH : %s", read_state(g_aggrematch[i].new_sym));
|
||||
*new_sym = g_aggrematch[i].new_sym;
|
||||
if (g_aggrematch[i].erase_sym)
|
||||
{
|
||||
pop_stack(stack, g_aggrematch[i].erase_sym);
|
||||
DG("stack after pop: %s", read_state(**stack));
|
||||
// DG("stack after pop: %s", read_state(**stack));
|
||||
}
|
||||
if (eval_sym(**stack, *new_sym))
|
||||
return ((*state = ERROR));
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/15 18:32:59 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 22:39:39 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:41:15 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -1009,7 +1009,7 @@ int eval_sym(t_sym stack, t_sym new_sym)
|
|||
{
|
||||
int i;
|
||||
|
||||
DG("eval head %s && sym %s", read_state(stack), read_state(new_sym));
|
||||
// DG("eval head %s && sym %s", read_state(stack), read_state(new_sym));
|
||||
i = 0;
|
||||
while (g_stackmatch[i].top)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,13 +29,11 @@ static int end_instruction(t_sym sym)
|
|||
|
||||
int ft_parse(t_btree **ast, t_list **token, t_parser *parser)
|
||||
{
|
||||
(void)ast;
|
||||
if (parser->state == SUCCESS || parser->state == ERROR)
|
||||
parser_init(parser);
|
||||
while (*token)
|
||||
{
|
||||
produce_sym(*parser->stack, parser->new_sym, token);
|
||||
DG("new sym %s", read_state(*parser->new_sym));
|
||||
//DG("new sym %s", read_state(*parser->new_sym));
|
||||
|
||||
if (eval_sym(*parser->stack, *parser->new_sym))
|
||||
return ((parser->state = ERROR));
|
||||
else
|
||||
|
|
@ -43,14 +41,14 @@ int ft_parse(t_btree **ast, t_list **token, t_parser *parser)
|
|||
aggregate_sym(&parser->stack, parser->new_sym, &parser->state);
|
||||
push_stack(++parser->stack, *parser->new_sym);
|
||||
}
|
||||
ft_read_stack(parser->stack);
|
||||
// ft_read_stack(parser->stack);
|
||||
DG("\n");
|
||||
if (*parser->stack == PROGRAM)
|
||||
parser->state = SUCCESS;
|
||||
else
|
||||
parser->state = UNDEFINED;
|
||||
build_tree(ast, token);
|
||||
btree_print(STDBUG, *ast, &ft_putast);
|
||||
// btree_print(STDBUG, *ast, &ft_putast);
|
||||
if ((end_instruction(*parser->stack) && !(*token)->next))
|
||||
insert_linebreak(token);
|
||||
else
|
||||
|
|
@ -58,6 +56,5 @@ int ft_parse(t_btree **ast, t_list **token, t_parser *parser)
|
|||
}
|
||||
if (parser->state == SUCCESS)
|
||||
DG("sucessful parsing");
|
||||
DG("yolo");
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/21 16:14:04 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 22:54:37 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:37 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/09 17:58:34 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 14:40:24 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:41 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -105,8 +105,8 @@ int produce_sym(t_sym stack, t_sym *new_sym, t_list **lst)
|
|||
int i;
|
||||
|
||||
token = (*lst)->content;
|
||||
DG("produce stack : %s && token : %s", read_state(stack),
|
||||
read_state(token->type));
|
||||
// DG("produce stack : %s && token : %s", read_state(stack),
|
||||
// read_state(token->type));
|
||||
i = 0;
|
||||
*new_sym = 0;
|
||||
while (g_prodmatch[i].new_sym)
|
||||
|
|
@ -114,7 +114,7 @@ int produce_sym(t_sym stack, t_sym *new_sym, t_list **lst)
|
|||
if (token->type == g_prodmatch[i].token
|
||||
&& stack == g_prodmatch[i].stack)
|
||||
{
|
||||
DG("MATCH : %s", read_state(g_prodmatch[i].new_sym));
|
||||
// DG("MATCH : %s", read_state(g_prodmatch[i].new_sym));
|
||||
*new_sym = g_prodmatch[i].new_sym;
|
||||
}
|
||||
i++;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/09 16:48:30 by ariard #+# #+# */
|
||||
/* Updated: 2017/02/13 20:19:33 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:45 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/09 15:32:10 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 22:53:39 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:47 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/15 18:57:44 by ariard #+# #+# */
|
||||
/* Updated: 2017/03/01 16:47:13 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/02 21:40:48 by ariard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -26,8 +26,8 @@ int gen_node(t_btree **ast)
|
|||
if (!*ast)
|
||||
{
|
||||
*ast = btree_create_node(&item, sizeof(item));
|
||||
((t_astnode *)(*ast)->item)->data.cmd.redir = NULL;
|
||||
((t_astnode *)(*ast)->item)->data.cmd.token = NULL;
|
||||
ft_bzero((void *)&((t_astnode *)(*ast)->item)->data, sizeof(t_astdata));
|
||||
// ((t_astnode *)(*ast)->item)->data.cmd.token = NULL;
|
||||
((t_astnode *)(*ast)->item)->nest = 0;
|
||||
((t_astnode *)(*ast)->item)->full = 0;
|
||||
((t_astnode *)(*ast)->item)->type = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue