remove leak; dashdash bug fix

This commit is contained in:
Xamora 2025-01-10 16:39:24 +01:00
parent 9e57c380fd
commit 7c660d5f7b

View file

@ -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));