Skip to content

Commit

Permalink
Merge pull request adrianlopezroche#129 from valentijnscholten/origin…
Browse files Browse the repository at this point in the history
…/valentijnscholten-patch-128

Exclude directories from minsize/maxsize check (adrianlopezroche#128)
  • Loading branch information
adrianlopezroche authored Dec 28, 2019
2 parents 3a9b2b6 + 7ad4c5c commit bb57685
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fdupes.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,17 @@ int grokdir(char *dir, file_t **filelistp, struct stat *logfile_status)
free(fullname);
}

size = filesize(newfile->d_name);
if ((size == 0 && ISFLAG(flags, F_EXCLUDEEMPTY)) || size < minsize || (size > maxsize && maxsize != -1)) {
free(newfile->d_name);
free(newfile);
continue;
}

if (stat(newfile->d_name, &info) == -1) {
free(newfile->d_name);
free(newfile);
continue;
free(newfile->d_name);
free(newfile);
continue;
}

size = filesize(newfile->d_name);
if (!S_ISDIR(info.st_mode) && (((size == 0 && ISFLAG(flags, F_EXCLUDEEMPTY)) || size < minsize || (size > maxsize && maxsize != -1)))) {
free(newfile->d_name);
free(newfile);
continue;
}

if (info.st_dev == logfile_status->st_dev && info.st_ino == logfile_status->st_ino)
Expand Down

0 comments on commit bb57685

Please sign in to comment.