diff --git a/42sh/src/builtin/builtin_math.c b/42sh/src/builtin/builtin_math.c index 21492d7f..66bc1bdd 100644 --- a/42sh/src/builtin/builtin_math.c +++ b/42sh/src/builtin/builtin_math.c @@ -6,13 +6,13 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/17 18:54:00 by ariard #+# #+# */ -/* Updated: 2017/03/23 15:06:18 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:56:57 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -#define MATHERR_0 "usage: math variable operator(+-/*%) operand" +#define MATHERR_0 "usage: math variable operator(add/sub/mul/div/mod) operand" #define MATHERR_2 "math: %c: invalid operator" #define MATHERR_3 "math: %s: operand must be digits only" #define MATHERR_4 "math: division by 0" @@ -45,10 +45,8 @@ int builtin_math(const char *path, char *const av[], char *const envp[]) (void)path; (void)envp; - DG(); if (!av || !av[0] || !av[1] || !av[2] || !av[3] || av[4]) return (SH_ERR(MATHERR_0)); - DG(); value = ft_getenv(data_singleton()->local_var, av[1]); operator = av[2][0]; if (!(ft_strchr("+-/*%", operator))) diff --git a/42sh/src/exec/node_copy.c b/42sh/src/exec/node_copy.c index 78cffe56..a192715a 100644 --- a/42sh/src/exec/node_copy.c +++ b/42sh/src/exec/node_copy.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 03:38:36 by wescande #+# #+# */ -/* Updated: 2017/03/23 16:28:41 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:35:19 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/plaunch_function.c b/42sh/src/exec/plaunch_function.c index d7759396..100dbb18 100644 --- a/42sh/src/exec/plaunch_function.c +++ b/42sh/src/exec/plaunch_function.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 03:23:59 by wescande #+# #+# */ -/* Updated: 2017/03/23 15:06:30 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:35:59 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,12 +17,12 @@ int plaunch_function(t_process *p) { - static int protection; + static int protection; if (!protection) protection = 0; if (protection >= FUNC_LVL) - return(SH_ERR(FUNCERR_0)); + return (SH_ERR(FUNCERR_0)); protection++; ft_exec(&p->data.function.content); protection--; diff --git a/42sh/src/exec/process_redirect.c b/42sh/src/exec/process_redirect.c index 743382d2..6b5a50de 100644 --- a/42sh/src/exec/process_redirect.c +++ b/42sh/src/exec/process_redirect.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/29 16:04:18 by jhalford #+# #+# */ -/* Updated: 2017/03/23 16:06:39 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:35:25 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -37,7 +37,6 @@ int process_redirect(t_process *p) while (redirs) { redir = redirs->content; - DG("redir type is %s", read_state(redir->type)); if (redir->n > 9) return (bad_fd(redir->n)); i = -1; diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index 4ae34096..2fe96836 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: gwojda +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */ -/* Updated: 2017/03/23 15:16:07 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:42:30 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -49,7 +49,6 @@ static int handle_instruction(t_list **token, t_btree **ast) else if (ret > 0) break ; } - btree_print(STDBUG, *ast, &ft_putast); if (data->parser.state == SUCCESS && ft_exec(ast) < 0) exit(1); else if (data->parser.state != SUCCESS) diff --git a/42sh/src/parser/add_cmd.c b/42sh/src/parser/add_cmd.c index 8a6b896b..332ad7cb 100644 --- a/42sh/src/parser/add_cmd.c +++ b/42sh/src/parser/add_cmd.c @@ -6,13 +6,13 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/15 20:49:15 by ariard #+# #+# */ -/* Updated: 2017/03/23 16:29:12 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:49:28 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -t_distrostree g_distrostree[] = +static t_distrostree g_distrostree[] = { {&superflous_token, &add_null}, {&isloop, &add_loop_cmd}, diff --git a/42sh/src/parser/aggregate_sym.c b/42sh/src/parser/aggregate_sym.c index 69796880..640c04be 100644 --- a/42sh/src/parser/aggregate_sym.c +++ b/42sh/src/parser/aggregate_sym.c @@ -6,13 +6,13 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/11 15:58:38 by ariard #+# #+# */ -/* Updated: 2017/03/23 16:03:22 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:48:38 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -t_aggrematch g_aggrematch[] = +static t_aggrematch g_aggrematch[] = { {TK_WORD, CMD_SUFFIX, CMD_SUFFIX, 0}, {TK_WORD, TK_PIPE, PATTERN, 0}, @@ -39,7 +39,6 @@ t_aggrematch g_aggrematch[] = {TK_ESAC, TK_IN, CASE_CLAUSE, TK_CASE}, {TK_ESAC, CASE_LIST_NS, CASE_CLAUSE, TK_CASE}, {TK_PAREN_CLOSE, SUBSHELL, SUBSHELL, TK_PAREN_OPEN}, -// {TK_PAREN_CLOSE, SEMI_SUBSHELL, SUBSHELL, TK_PAREN_OPEN}, {TK_PAREN_CLOSE, COMPOUND_LIST, SUBSHELL, TK_PAREN_OPEN}, {TK_PAREN_CLOSE, CMD_SUPERIOR, SUBSHELL, TK_PAREN_OPEN}, {TK_PAREN_CLOSE, PIPE_SEMI_SEQUENCE, SUBSHELL, TK_PAREN_OPEN}, diff --git a/42sh/src/parser/build_tree.c b/42sh/src/parser/build_tree.c index dd3c3883..afbb8fc4 100644 --- a/42sh/src/parser/build_tree.c +++ b/42sh/src/parser/build_tree.c @@ -6,13 +6,13 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/15 18:32:59 by ariard #+# #+# */ -/* Updated: 2017/03/23 15:26:31 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:49:18 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -t_treematch g_treematch[] = +static t_treematch g_treematch[] = { {TK_WORD, &add_cmd}, {TK_PIPE, &add_sep}, diff --git a/42sh/src/parser/eval_sym.c b/42sh/src/parser/eval_sym.c index aea47306..e6e8fce3 100644 --- a/42sh/src/parser/eval_sym.c +++ b/42sh/src/parser/eval_sym.c @@ -6,13 +6,13 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/11 16:11:21 by ariard #+# #+# */ -/* Updated: 2017/03/23 16:04:51 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:48:22 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -t_stackmatch g_stackmatch[] = +static t_stackmatch g_stackmatch[] = { {TK_WORD, CMD_SUFFIX}, {TK_WORD, TK_PIPE}, diff --git a/42sh/src/parser/produce_sym.c b/42sh/src/parser/produce_sym.c index 661940b5..ab5feb97 100644 --- a/42sh/src/parser/produce_sym.c +++ b/42sh/src/parser/produce_sym.c @@ -6,13 +6,13 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/09 17:58:34 by ariard #+# #+# */ -/* Updated: 2017/03/22 21:51:30 by ariard ### ########.fr */ +/* Updated: 2017/03/23 16:47:59 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" -t_prodmatch g_prodmatch[] = +static t_prodmatch g_prodmatch[] = { {TK_WORD, TK_DLESS, HERE_END}, {TK_WORD, TK_DLESSDASH, HERE_END},