From c2f9ecbcab2114b7c8127f787041c137cb98736f Mon Sep 17 00:00:00 2001 From: wescande Date: Fri, 24 Mar 2017 17:01:14 +0100 Subject: [PATCH 1/3] norme on BT_func --- 42sh/src/builtin/builtin_func.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/42sh/src/builtin/builtin_func.c b/42sh/src/builtin/builtin_func.c index efbe3cc8..419e60b1 100644 --- a/42sh/src/builtin/builtin_func.c +++ b/42sh/src/builtin/builtin_func.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/24 15:03:02 by wescande #+# #+# */ -/* Updated: 2017/03/24 15:30:13 by wescande ### ########.fr */ +/* Updated: 2017/03/24 17:00:56 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,11 +26,8 @@ int builtin_func(const char *path, if (!argv || !argv[0] || argv[1]) return (SH_ERR("usage: %s", FUNC_USAGE) ? 1 : 1); list = data_singleton()->lst_func; - DG(); - int toto = 0; while (list) { - DG(">>>>>>>%d", toto++); if (!(ast = list->content)) return (SH_ERR("unexpected error")); name = token_to_argv(((t_astnode *)(*ast)->item)->data.cmd.token, 1); From 9c60efc70ceaa28cb38f8c7dfa0680d7399e57a7 Mon Sep 17 00:00:00 2001 From: wescande Date: Fri, 24 Mar 2017 17:03:00 +0100 Subject: [PATCH 2/3] norm on lexer_bquote --- 42sh/src/lexer/lexer_bquote.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/42sh/src/lexer/lexer_bquote.c b/42sh/src/lexer/lexer_bquote.c index c2749334..ff9fff8c 100644 --- a/42sh/src/lexer/lexer_bquote.c +++ b/42sh/src/lexer/lexer_bquote.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/09 22:03:48 by jhalford #+# #+# */ -/* Updated: 2017/03/23 15:17:27 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 17:02:40 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,10 +25,8 @@ int lexer_bquote(t_list **alst, t_lexer *lexer) if (get_lexer_stack(*lexer) != BQUOTE) push(&lexer->stack, lexer->state); else - { lexer->state = pop(&lexer->stack) && get_lexer_stack(*lexer) == DQUOTE ? DQUOTE : DEFAULT; - } } else if (lexer->str[lexer->pos] == '\\' && (back = 1)) { From bf093784d39e1e2fd53c5e8b2e8711e4b67caac2 Mon Sep 17 00:00:00 2001 From: wescande Date: Fri, 24 Mar 2017 17:05:49 +0100 Subject: [PATCH 3/3] norme on shell_init --- 42sh/src/main/shell_init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/42sh/src/main/shell_init.c b/42sh/src/main/shell_init.c index 16844a6f..c1882171 100644 --- a/42sh/src/main/shell_init.c +++ b/42sh/src/main/shell_init.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */ -/* Updated: 2017/03/24 15:12:31 by jhalford ### ########.fr */ +/* Updated: 2017/03/24 17:05:29 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,10 +29,9 @@ int get_c_arg(char ***av, t_data *data) return (0); } -static int get_input_fd(t_data *data) +static int get_input_fd(t_data *data, char *file) { static int fds[2] = {-1, STDIN}; - char *file; struct stat buf; if (data->opts & SH_OPTS_LC && (file = data->c_arg)) @@ -94,7 +93,7 @@ int shell_init(int ac, char **av) } if (!isatty(STDIN) || *data->av_data) data->opts &= ~(SH_INTERACTIVE | SH_OPTS_JOBC); - if ((data->fd = get_input_fd(data)) < 0) + if ((data->fd = get_input_fd(data, NULL)) < 0) return (-1); if (SH_IS_INTERACTIVE(data->opts) && interactive_settings() < 0) return (-1);