diff --git a/src/parsing.c b/src/parsing.c index 1e084d8..9f6c8a5 100644 --- a/src/parsing.c +++ b/src/parsing.c @@ -52,13 +52,14 @@ parsing(char **argv, t_list ***files, t_list ***dirs, i32 *max_size, i32 *len, i static void* free_dir_return_null(dir_t *dir) { free(dir->path); + free(dir->name); free(dir); return NULL; } dir_t * get_directory_files(char *path) { - if (path[0] == '-' && ft_strlen(path) != 1) + if (!flags.dashdash && path[0] == '-' && ft_strlen(path) != 1) return NULL; dir_t *dir = ft_calloc(1, sizeof(dir_t));