some pair debugging

This commit is contained in:
Khaïs COLIN 2025-03-20 14:52:12 +01:00 committed by Jérôme Guélen
parent 46c288c858
commit 41c9548934
No known key found for this signature in database
3 changed files with 63 additions and 12 deletions

View file

@ -3,14 +3,14 @@
/* ::: :::::::: */
/* wildcard_exp.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jguelen <jguelen@student.42.fr> +#+ +:+ +#+ */
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/23 15:02:59 by jguelen #+# #+# */
/* Updated: 2025/03/20 14:17:37 by jguelen ### ########.fr */
/* Created: 2025/03/20 15:01/38 by khais #+# #+# */
/* Updated: 2025/03/20 15:01:38 by khais ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
#include "libft.h"
#include "subst.h"
#include "replace_substr.h"
@ -96,6 +96,7 @@ static t_wordlist *expand_star_core(t_worddesc *file_pattern)
new = readdir(current_dir);
while (new)
{
ft_printf("[dbg] read dir entry: %s\n", new->d_name);
if (fits_pattern(new->d_name, file_pattern))
{
if (add_file_to_list(&file_wordlist, new->d_name) == NULL)
@ -127,6 +128,8 @@ char fits_pattern(char *str, t_worddesc *pattern)
size_t i;
char ret;
if (ft_strcmp(".", str) == 0)
ft_printf("[dbg] currently matching .\n");
pattern_len = ft_strlen(pattern->word);
str_len = ft_strlen(str);
pattern_check = ft_calloc(str_len + 1, sizeof(char *));