From 7f85951e4360269c7af09b3471fa5373e213604b Mon Sep 17 00:00:00 2001 From: tomoron Date: Thu, 25 Apr 2024 10:38:02 +0200 Subject: [PATCH] fix ************************************* --- srcs/here_doc.c | 4 ++-- srcs/wildcards.c | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/srcs/here_doc.c b/srcs/here_doc.c index 380041a..8e06763 100755 --- a/srcs/here_doc.c +++ b/srcs/here_doc.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/24 17:44:32 by marde-vr #+# #+# */ -/* Updated: 2024/04/24 10:40:41 by marde-vr ### ########.fr */ +/* Updated: 2024/04/25 10:16:53 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,7 +24,7 @@ void get_here_doc_input(t_msh *msh, char *eof) if (!line) { ft_printf_fd(2, "\nminishell: warning: here-document delimited by"); - ft_printf_fd(2, " end-of-file, (wanted `%s')", eof); + ft_printf_fd(2, " end-of-file, (wanted `%s')\n", eof); break ; } if (line && !ft_strncmp(line, eof, ft_strlen(eof))) diff --git a/srcs/wildcards.c b/srcs/wildcards.c index 8f94ced..89456db 100644 --- a/srcs/wildcards.c +++ b/srcs/wildcards.c @@ -6,7 +6,7 @@ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/15 12:53:29 by tomoron #+# #+# */ -/* Updated: 2024/04/24 20:37:10 by marde-vr ### ########.fr */ +/* Updated: 2024/04/25 10:35:48 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" @@ -19,14 +19,13 @@ int filename_corresponds(char *wildcard, char *value) { if (*wildcard == '*') { + while(*wildcard == '*' && wildcard[1] == '*') + wildcard++; if (!wildcard[1]) return (1); while (*value) - { - if (filename_corresponds(wildcard + 1, value)) + if (filename_corresponds(wildcard + 1, value++)) return (1); - value++; - } return (0); } else if (*wildcard == *value)