aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-06 17:07:46 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-06 17:07:46 +0200
commitfc862343cc5d0c305811fe23311084ae3702ed42 (patch)
tree6417bd07fd58dab95eea3193acfd5230f0ff57f1 /src/main.c
parent54394620893f7245c7697a57d724d430d06b57d1 (diff)
downloadminishell-fc862343cc5d0c305811fe23311084ae3702ed42.tar.gz
minishell-fc862343cc5d0c305811fe23311084ae3702ed42.tar.bz2
minishell-fc862343cc5d0c305811fe23311084ae3702ed42.zip
Fixing error status on mac, Fixing parser pipeline segfault, Fixing pipeline not closing read-end
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 3398814..7898547 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/10/06 10:36:28 by cacharle ### ########.fr */
+/* Updated: 2020/10/06 16:14:07 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -43,11 +43,11 @@ int execute(t_env env, char *input)
return (status);
parser_out = parse(lexer_out);
if (parser_out == NULL || parser_out->syntax_error)
- return (1);
+ return (2);
fds[0] = FD_NONE;
fds[1] = FD_NONE;
status = eval(fds, env, parser_out->ast, NULL, FD_NONE);
- ast_destroy(parser_out->ast);
+ /* ast_destroy(parser_out->ast); */
free(parser_out);
if (status == EVAL_FATAL)
exit(1);
@@ -69,11 +69,11 @@ int repl(t_env env)
continue ;
}
if (execute(env, line) == EVAL_FATAL)
- return (1);
+ return (2);
print_prompt();
}
if (ret != FTGL_EOF)
- return (1);
+ return (2);
return (0);
}