|
@ -86,6 +86,7 @@ t_token *parse_cmd(t_datas *datas, t_token *tok, t_command *cmd) |
|
|
free(prev_tok); |
|
|
free(prev_tok); |
|
|
return (tok); |
|
|
return (tok); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
t_command *parser(t_datas *datas, t_token *tok, t_command *prev) |
|
|
t_command *parser(t_datas *datas, t_token *tok, t_command *prev) |
|
|
{ |
|
|
{ |
|
|
t_command *cmd; |
|
|
t_command *cmd; |
|
@ -99,7 +100,6 @@ t_command *parser(t_datas *datas, t_token *tok, t_command *prev) |
|
|
cmd->argc = 0; |
|
|
cmd->argc = 0; |
|
|
while(tok && tok->type != PIPE) |
|
|
while(tok && tok->type != PIPE) |
|
|
tok = parse_cmd(datas, tok, cmd); |
|
|
tok = parse_cmd(datas, tok, cmd); |
|
|
cmd->argv[cmd->argc] = NULL; |
|
|
|
|
|
if (tok && tok->type == PIPE) |
|
|
if (tok && tok->type == PIPE) |
|
|
{ |
|
|
{ |
|
|
cmd->next = parser(datas, tok->next, cmd); |
|
|
cmd->next = parser(datas, tok->next, cmd); |
|
@ -108,5 +108,3 @@ t_command *parser(t_datas *datas, t_token *tok, t_command *prev) |
|
|
} |
|
|
} |
|
|
return(cmd); |
|
|
return(cmd); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|