From e9f9ede1f1117dc2bb530bac86c73001410e4f11 Mon Sep 17 00:00:00 2001 From: mdev9 Date: Mon, 29 Apr 2024 11:15:54 +0200 Subject: [PATCH] fixed wildcards and makefile --- Makefile | 3 +-- libft/Makefile | 5 +++-- libft/libft.h | 3 ++- srcs/minishell.h | 2 +- srcs/wildcards.c | 4 +++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 84f9691..724957b 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # By: marde-vr +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/07/28 00:35:01 by tomoron #+# #+# # -# Updated: 2024/04/26 16:08:22 by tomoron ### ########.fr # +# Updated: 2024/04/29 10:28:55 by marde-vr ### ########.fr # # # # **************************************************************************** # @@ -22,7 +22,6 @@ SRCS_RAW = main.c\ pwd.c\ env.c\ parsing.c\ - debug.c\ env_utils.c\ parsing_var.c\ path.c\ diff --git a/libft/Makefile b/libft/Makefile index 060202a..5dd1e3b 100755 --- a/libft/Makefile +++ b/libft/Makefile @@ -6,7 +6,7 @@ # By: tomoron +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/07/28 00:35:01 by tomoron #+# #+# # -# Updated: 2024/04/02 16:02:33 by tomoron ### ########.fr # +# Updated: 2024/04/29 11:13:55 by marde-vr ### ########.fr # # # # **************************************************************************** # @@ -52,7 +52,8 @@ SRCS = ft_atoi.c\ ft_split_set.c\ ft_free_str_arr.c\ ft_set_color.c\ - ft_isspace.c + ft_isspace.c\ + ft_str_is_only_char.c\ SRCS_BONUS = ft_lstnew.c\ ft_lstadd_front.c\ diff --git a/libft/libft.h b/libft/libft.h index 73cdbdb..f5c5f3e 100755 --- a/libft/libft.h +++ b/libft/libft.h @@ -6,7 +6,7 @@ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/10/30 16:55:48 by tomoron #+# #+# */ -/* Updated: 2024/02/11 17:41:32 by tomoron ### ########.fr */ +/* Updated: 2024/04/29 11:12:16 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ @@ -46,6 +46,7 @@ void ft_lstadd_front(t_list **lst, t_list *new); char **ft_split(char const *str, char charset); void ft_lstadd_back(t_list **lst, t_list *new); char **ft_split_set(char *str, char *charset); +int ft_str_is_only_char(char *str, char c); void *ft_memset(void *s, int c, size_t n); char *ft_get_color(int r, int g, int b); void *ft_calloc(size_t nb, size_t size); diff --git a/srcs/minishell.h b/srcs/minishell.h index 9b09245..52adb0c 100755 --- a/srcs/minishell.h +++ b/srcs/minishell.h @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */ -/* Updated: 2024/04/26 15:50:36 by marde-vr ### ########.fr */ +/* Updated: 2024/04/29 11:12:35 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/srcs/wildcards.c b/srcs/wildcards.c index d197325..37324bb 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/26 17:40:00 by marde-vr ### ########.fr */ +/* Updated: 2024/04/29 11:12:40 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ #include "minishell.h" @@ -42,6 +42,8 @@ int filename_corresponds(char *wildcard, char *value) { wildcard++; value++; + if (ft_str_is_only_char(wildcard, '*') && !*value) + return (1); } else return (0);