c est la faute a jack close #149

This commit is contained in:
Antoine Riard 2017-03-23 16:58:22 +01:00
parent d45f92afc5
commit 37cf3fa86c
10 changed files with 18 additions and 23 deletions

View file

@ -6,13 +6,13 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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)))

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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--;

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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;

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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)

View file

@ -6,13 +6,13 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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},

View file

@ -6,13 +6,13 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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},

View file

@ -6,13 +6,13 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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},

View file

@ -6,13 +6,13 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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},

View file

@ -6,13 +6,13 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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},