aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 16c6267..e5c9bf9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,7 +6,7 @@
/* By: cacharle <cacharle@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/28 11:45:44 by cacharle #+# #+# */
-/* Updated: 2020/07/13 14:55:16 by nahaddac ### ########.fr */
+/* Updated: 2020/07/14 09:41:42 by nahaddac ### ########.fr */
/* */
/* ************************************************************************** */
@@ -85,7 +85,6 @@ int main(int argc, char **argv, char **envp)
/* ft_lstiter(lex_out, token_debug); */
t_ret *parser_out = parse(lex_out);
- printf("%s\n","ssss" );
if (parser_out == NULL || parser_out->unexpected != NULL)
return (1);
@@ -98,7 +97,6 @@ int main(int argc, char **argv, char **envp)
/* ft_lstiter(parser_out->ast->cmd_argv, token_debug); */
/* printf("===redirs===\n"); */
/* ft_lstiter(parser_out->ast->redirs, token_debug); */
- printf("%s\n", "salut ");
int fds[2] = {MS_NO_FD, MS_NO_FD};
int eval_out = eval(fds, env, path, parser_out->ast);
(void)eval_out;
@@ -121,6 +119,11 @@ int main(int argc, char **argv, char **envp)
return (1);
t_ret *parser_out = parse(lex_out);
+ if (parser_out == NULL || parser_out->unexpected != NULL)
+ {
+ printf("%s\n",((t_token *)parser_out->unexpected)->content);
+ return (1);
+ }
int fds[2] = {MS_NO_FD, MS_NO_FD};
int eval_out = eval(fds, env, path, parser_out->ast);