From 605d9dd2eba529a31c51965c8143529bc5d6f531 Mon Sep 17 00:00:00 2001 From: Adam Joly Date: Mon, 15 Jul 2024 16:25:15 +0200 Subject: [PATCH] =?UTF-8?q?=E3=80=8C=F0=9F=94=A8=E3=80=8D=20fix:=20fixed?= =?UTF-8?q?=20./{file}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parsing/tokenizer/__to_redir.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parsing/tokenizer/__to_redir.c b/src/parsing/tokenizer/__to_redir.c index 6b3cfe1..55b58ce 100644 --- a/src/parsing/tokenizer/__to_redir.c +++ b/src/parsing/tokenizer/__to_redir.c @@ -6,11 +6,12 @@ /* By: adjoly +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/25 15:06:15 by adjoly #+# #+# */ -/* Updated: 2024/07/15 14:12:50 by adjoly ### ########.fr */ +/* Updated: 2024/07/15 16:22:01 by adjoly ### ########.fr */ /* */ /* ************************************************************************** */ #include "tokenizer.h" +#include t_redirection *__to_redir(char *redir_s) { @@ -29,10 +30,9 @@ t_redirection *__to_redir(char *redir_s) tmp = redir_s; if (!ft_isalnum(*tmp) && *tmp != '/' && *tmp != '.') return (redir); - while (*tmp && ft_isalnum(*tmp) && *tmp != '/' && *tmp != '.') + while (*tmp && (ft_isalnum(*tmp) || *tmp == '/' || *tmp == '.')) tmp++; redir->file_name = ft_calloc(tmp - redir_s + 1, sizeof(char)); ft_strlcpy(redir->file_name, redir_s, tmp - redir_s + 1); - redir_s += (tmp - redir_s); return (redir); }