expander * fix

This commit is contained in:
Loic Deridder
2025-02-15 11:41:06 +01:00
parent 25ce220cf3
commit dbc2813ad8

View File

@@ -58,7 +58,7 @@ void expander_star(t_ast_n *node, int j, char *pat)
entry = readdir(dir); entry = readdir(dir);
while (entry != NULL) while (entry != NULL)
{ {
if (ft_strncmp(entry->d_name, ".", 1) == 0) if (ft_strncmp(entry->d_name, ".", 1) == 0 && *pat != '.')
entry = readdir(dir); entry = readdir(dir);
else if (ft_fnmatch(entry->d_name, pat) == true) else if (ft_fnmatch(entry->d_name, pat) == true)
{ {