From 2f0fc3b51151ac88e993d83a0926facbf9701248 Mon Sep 17 00:00:00 2001 From: Antoine Riard Date: Thu, 23 Mar 2017 17:26:56 +0100 Subject: [PATCH] math fix + historique done fi --- 42sh/Makefile | 4 ++-- 42sh/src/builtin/builtin_math.c | 4 ++-- 42sh/src/lexer/isrw_delim.c | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/42sh/Makefile b/42sh/Makefile index fc426b65..022edaf7 100644 --- a/42sh/Makefile +++ b/42sh/Makefile @@ -6,14 +6,14 @@ # By: wescande +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2016/08/29 21:32:58 by wescande #+# #+# # -# Updated: 2017/03/23 16:49:08 by gwojda ### ########.fr # +# Updated: 2017/03/23 17:01:20 by ariard ### ########.fr # # # # **************************************************************************** # NAME = 42sh CC = gcc -FLAGS = -Wall -Wextra -Werror #-fvisibility=hidden -fsanitize=address +FLAGS = -Wall -Wextra -Werror -fvisibility=hidden -fsanitize=address D_FLAGS = -g DELTA = $$(echo "$$(tput cols)-47"|bc) diff --git a/42sh/src/builtin/builtin_math.c b/42sh/src/builtin/builtin_math.c index 66bc1bdd..d50788bf 100644 --- a/42sh/src/builtin/builtin_math.c +++ b/42sh/src/builtin/builtin_math.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/17 18:54:00 by ariard #+# #+# */ -/* Updated: 2017/03/23 16:56:57 by ariard ### ########.fr */ +/* Updated: 2017/03/23 17:16:43 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,7 +56,7 @@ int builtin_math(const char *path, char *const av[], char *const envp[]) return (SH_ERR(MATHERR_3, operand)); if (!(value = do_math(value, operator, operand))) return (1); - builtin_setenv("setenv", (char *[]){"math", av[1], value, 0}, NULL); + builtin_setenv("setenv", (char *[]){"local", av[1], value, 0}, NULL); ft_strdel(&value); return (0); } diff --git a/42sh/src/lexer/isrw_delim.c b/42sh/src/lexer/isrw_delim.c index bb9e9af3..cede1c3d 100644 --- a/42sh/src/lexer/isrw_delim.c +++ b/42sh/src/lexer/isrw_delim.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/20 19:12:50 by ariard #+# #+# */ -/* Updated: 2017/03/22 16:38:33 by gwojda ### ########.fr */ +/* Updated: 2017/03/23 17:25:03 by ariard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,9 +17,8 @@ int isrw_delim(t_type type) return (type == TK_NEWLINE || type == TK_AMP || type == TK_SEMI || type == TK_PIPE || type == TK_WHILE || type == TK_UNTIL - || type == TK_DONE || type == TK_RBRACE || type == TK_DO || type == TK_IF - || type == TK_FI || type == TK_THEN + || type == TK_THEN || type == TK_RBRACE || type == TK_ELIF || type == TK_ELSE || type == TK_DSEMI || type == TK_PAREN_CLOSE || type == TK_PAREN_OPEN || type == TK_LBRACE