From 9d15c79d02d9e15e8ef379204399d65be4a7fa0d Mon Sep 17 00:00:00 2001 From: tomoron Date: Fri, 16 Feb 2024 14:52:50 +0100 Subject: [PATCH] space at the end --- parsing.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/parsing.c b/parsing.c index 9a44d82..859c618 100755 --- a/parsing.c +++ b/parsing.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/09 15:26:01 by tomoron #+# #+# */ -/* Updated: 2024/02/16 14:25:36 by tomoron ### ########.fr */ +/* Updated: 2024/02/16 14:52:11 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" @@ -64,8 +64,13 @@ t_token_type get_token_type(char **command) res = RED_I; else if((*command)[0] == '|') res = PIPE; - - return (ARG); + else + res = ARG; + if(res == OR || res == AND || res == RED_O_APP || res == HERE_DOC) + (*command) += 2; + if (res == RED_O || res == RED_I || res == PIPE) + (*command)++; + return (res); } t_cmd *parse_command(char *command, t_env *env) @@ -87,6 +92,8 @@ t_cmd *parse_command(char *command, t_env *env) else token = 0; res = cmd_add_back(res, token, type); + while (ft_isspace(*command)) + command++; } if (command && (in_quote || in_dquote)) {